Skip to content

experiment/sevennet#323

Open
timurbazhirov wants to merge 4 commits into
experiment/mattersimfrom
experiment/sevennet
Open

experiment/sevennet#323
timurbazhirov wants to merge 4 commits into
experiment/mattersimfrom
experiment/sevennet

Conversation

@timurbazhirov
Copy link
Copy Markdown
Member

@timurbazhirov timurbazhirov commented May 20, 2026

  • experiment: support for uma
  • chore: update uma logic
  • chore: antlr package
  • chore: git attributes
  • chore: f16 pt file
  • chore: update notebook
  • chore: update notebook
  • chore: int8 pt file
  • Revert "chore: update notebook"
  • Revert "chore: update notebook"
  • chore: update notebook
  • poc: use playwright for notebook tests
  • experiment: dequantization to save space/memory
  • feature: mattersim poc added
  • feature: sevennet poc added

Summary by CodeRabbit

Release Notes

  • New Features

    • Added three new interactive notebooks for material structure relaxation using MatterSim, SevenNet, and UMA interatomic potentials in JupyterLite.
    • Extended notebook environment configuration to support additional machine learning models and dependencies.
  • Tests

    • Added Playwright-based end-to-end tests for notebook execution and validation.
  • Chores

    • Updated Git configuration for model artifact management.
    • Added Playwright dependency for automated testing.

Review Change Stack

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 158c2779-b75e-4d57-ba92-09bdb1d3594f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds three new JupyterLite notebook demonstrations for crystal structure relaxation using different interatomic potentials (FAIRChem UMA, MatterSim, and SevenNet), along with the necessary Pyodide/WebAssembly infrastructure, configuration, and validation tests.

Changes

Structural Relaxation Notebooks with Pyodide Support

Layer / File(s) Summary
Artifact & Configuration Setup
.gitattributes, .gitignore, config.yml, packages/antlr4_python3_runtime-4.9.3-py3-none-any.whl, packages/models/uma-s-1p1-f16.pt, packages/models/uma-s-1p1-int8.pt, tests/playwright/package.json
Git LFS rules for *.pt model files, Pyodide package lists for three notebooks (uma, mattersim, sevennet) with core dependencies and stubbed packages, ANTLR and UMA model artifact pointers, and Playwright test dependency.
Pyodide PyTorch Patching Infrastructure
src/py/mat3ra/notebooks_utils/pyodide/packages/torch.py
Enhanced patch_torch_linalg() with NumPy interop for tensor conversion and indexing; new patch_torch_compiler(), patch_torch_distributed(), patch_fairchem_deps(), patch_mattersim_deps(), and patch_sevennet_deps() functions; parameterized apply_all_patches(include_fairchem, include_mattersim, include_sevennet) to conditionally enable stubs for each framework.
FAIRChem UMA Structural Relaxation Notebook
other/experiments/jupyterlite/relax_structure_with_uma.ipynb
Sets input parameters (structure name, relaxation FMAX, UMA task/model path), installs packages and applies FAIRChem patches, loads structure from uploads or materials registry, constructs UMA calculator, runs BFGS optimization with Plotly energy tracking, and reports original vs. relaxed interlayer distances.
MatterSim Structural Relaxation Notebook
other/experiments/jupyterlite/relax_structure_with_mattersim.ipynb
Configures MatterSim checkpoint path and relaxation parameters, installs dependencies and enables MatterSim patches, loads structure with fallback, creates MatterSimCalculator, executes BFGS relaxation with live energy updates, visualizes original and relaxed structures, and computes interlayer distance changes.
SevenNet Structural Relaxation Notebook
other/experiments/jupyterlite/relax_structure_with_sevennet.ipynb
Defines structure loading and FMAX configuration, installs packages and applies SevenNet patches, loads pretrained SevenNet model, converts structure to ASE, runs BFGS relaxation with real-time Plotly chart updates (with FigureWidget fallback), and outputs before/after interlayer distances.
Playwright Notebook Validation Tests
tests/playwright/debug_cell8.mjs, tests/playwright/debug_sevennet.mjs, tests/playwright/debug_sevennet_cell7.mjs, tests/playwright/test-results/.last-run.json, tests/playwright/test_mattersim_notebook.mjs, tests/playwright/test_notebook.mjs, tests/playwright/test_sevennet_notebook.mjs
Playwright automation scripts that launch Chrome, navigate to JupyterLite notebooks, wait for kernel idle, trigger "Restart & Run All", poll execution progress via DOM inspection, collect per-cell outputs, detect failures via Traceback text, report results with exit codes, and close browser. Includes both general and model-specific test scripts.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Three potentials dance in JupyterLite's embrace,
UMA, MatterSim, SevenNet in WebAssembly's space,
With patches and with patches, the heavy models play,
Relaxing crystal structures in your browser, every day! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'experiment/sevennet' refers to a real and significant part of the changeset (SevenNet notebook and dependencies), but it is incomplete and does not capture the main scope of the PR, which includes UMA, MatterSim, PyTorch model files, Playwright tests, and configuration updates. Consider a more comprehensive title that reflects the primary objectives, such as 'Add experimental support for UMA, MatterSim, and SevenNet with PyTorch patches and notebook tests' or 'Add foundation model experiments and JupyterLite notebook tooling'.
Docstring Coverage ⚠️ Warning Docstring coverage is 11.36% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch experiment/sevennet

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@timurbazhirov timurbazhirov changed the base branch from main to experiment/mattersim May 20, 2026 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant