feat: add TorchSim integration for batch MD and relaxation#155
Open
yanghan234 wants to merge 11 commits intomainfrom
Open
feat: add TorchSim integration for batch MD and relaxation#155yanghan234 wants to merge 11 commits intomainfrom
yanghan234 wants to merge 11 commits intomainfrom
Conversation
Add a convenience function that wraps Potential.from_checkpoint() with gradient checkpointing support and automatic version normalization from checkpoint paths. Exported from mattersim.forcefield. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Port TorchSim support from the internal repo, providing GPU-accelerated batch molecular dynamics and structure relaxation via torch-sim. New package: mattersim.torchsim - TorchSimWrapper: adapts MatterSim Potential as a TorchSim ModelInterface - TorchSimBatchMD: batch MD with NVT/NPT integrators, temperature schedules - TorchSimBatchRelaxer: batch structure optimization with FIRE/etc. - Settings classes (IntegratorSettings, OptimizerSettings) with validation - Trajectory loading/saving via TorchSim H5MD format - Graph construction bridge (build_graph_from_simstate) - Model loading with AOTI compilation support Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
27 tests covering settings validation, TorchSimWrapper forward pass, batch relaxation (file + in-memory), batch MD with multiple integrators, trajectory continuation, per-system temperature schedules, and trajectory loader convenience constructors. GPU-heavy tests are marked @slow and @requires_gpu so they are skipped on CPU-only machines. Also adds mattersim_potential_best_device fixture to conftest.py. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
load_mattersim now always sets Potential.version so the pre-computed autobatcher memory scaler table is used instead of falling back to slow runtime memory estimation. - Default checkpoint (load_path=None) gets 'mattersim-v1.0.0-1M' - Explicit paths are normalized to canonical version strings Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Since requires-python is now >=3.12 (for torch-sim-atomistic), the python_version < 3.10 dependency conditionals for emmet-core and numpy are unreachable. Simplify to unconditional versions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Drop Python 3.10 from CI matrix since requires-python is now >=3.12. Add Python 3.13 to the test matrix. Update macOS job to 3.12. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Only build wheels for Python 3.12 and 3.13 since torch-sim-atomistic requires Python >=3.12. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update badge, prerequisite, and conda create example to reflect the new minimum Python 3.12 requirement. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…, cibuildwheel Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
23c4659 to
3abacda
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Port TorchSim support from the internal repo, providing GPU-accelerated batch molecular dynamics and structure relaxation via torch-sim.
Breaking Change: Python >=3.12 Required
torch-sim-atomisticrequires Python 3.12+, sorequires-pythonhas been bumped from>=3.10to>=3.12. All CI pipelines, docs, README, MODEL_CARD, environment.yaml, and cibuildwheel config have been updated accordingly.Changes
New package:
mattersim.torchsimTorchSimWrapper: adapts MatterSim Potential as a TorchSim ModelInterfaceTorchSimBatchMD: batch MD with NVT/NPT integrators, temperature schedulesTorchSimBatchRelaxer: batch structure optimization with FIRE/etc.IntegratorSettings,OptimizerSettings) with validationbuild_graph_from_simstate)New in
mattersim.forcefieldload_mattersim(): convenience function wrappingPotential.from_checkpoint()with version normalization and gradient checkpointing supportDependencies
torch-sim-atomistic>=0.5.0as required dependencyrequires-pythonfrom>=3.10to>=3.12CI/CD
Tests
27 new tests covering settings validation, wrapper forward pass, batch relaxation (file + in-memory), batch MD with multiple integrators, trajectory continuation, per-system temperature schedules, and trajectory loader. GPU tests marked
@slowand@requires_gpu.