Skip to content

Add torch-sim integration as a separate metatomic-torchsim package #167

Merged
Luthaf merged 1 commit intometatensor:mainfrom
CompRhys:main
Mar 17, 2026
Merged

Add torch-sim integration as a separate metatomic-torchsim package #167
Luthaf merged 1 commit intometatensor:mainfrom
CompRhys:main

Conversation

@CompRhys
Copy link
Contributor

Move the torchsim model upstream.

@Luthaf
Copy link
Member

Luthaf commented Feb 26, 2026

Thanks @CompRhys! We had a chat about this 1h ago, and plan to create a separate metatomic-torchsim (and metatomic-ase, …) python package that would live in this repository but have a separate version number and release schedule. This might take us a couple of weeks to do, how urgent is getting this code out of torchsim for you?

@HaoZeke in the mean time can you help bringing this PR in a state where it supports all the same features as the other engine integrations?

@HaoZeke
Copy link
Member

HaoZeke commented Feb 26, 2026

Thanks @CompRhys! We had a chat about this 1h ago, and plan to create a separate metatomic-torchsim (and metatomic-ase, …) python package that would live in this repository but have a separate version number and release schedule. This might take us a couple of weeks to do, how urgent is getting this code out of torchsim for you?

In the same vein, @CompRhys, would you be OK with me making changes to this PR? I'd like to setup the python package first.

@HaoZeke in the mean time can you help bringing this PR in a state where it supports all the same features as the other engine integrations?

Yup, in the package 😁

@CompRhys
Copy link
Contributor Author

Not urgent. We just cut a 0.5.2 release and so will be a while till we cut 0.5.3. Hopefully this could land in that release. The big switch also relies on there being new releases with the upstreamed interfaces for orb-models and sevenn.

Please feel free to take this over or delete!

@HaoZeke HaoZeke requested a review from Luthaf March 2, 2026 01:55
@CompRhys
Copy link
Contributor Author

CompRhys commented Mar 3, 2026

We decided to drop support for StateDict, I am confused about why there are two implementations so removed it from both both lmk if there are any issues

@HaoZeke
Copy link
Member

HaoZeke commented Mar 3, 2026

We decided to drop support for StateDict, I am confused about why there are two implementations so removed it from both both lmk if there are any issues

Sorry about that, the inline one should have been removed, since we now split into the standalone metatomic-torchsim. I think we should be able to merge this next week or so.

@HaoZeke HaoZeke marked this pull request as ready for review March 3, 2026 23:43
@CompRhys
Copy link
Contributor Author

CompRhys commented Mar 4, 2026

Thanks! look's great please let me know if there's anything I can help with.

HaoZeke added a commit to HaoZeke/metatomic that referenced this pull request Mar 11, 2026
- Restructure as flat metatomic_torchsim package (no namespace shims)
- Rename _calculator.py to _model.py (matches MetatomicModel class)
- Convert all md docs to rst under docs/src/engines/
- Remove separate docs/ directory, wire into main doc toctree
- Add version bounds: metatomic-torch >=0.1.11,<0.2, torch-sim >=0.5,<0.6
- Remove towncrier/tbump config (premature for unreleased package)
- Update URLs to point to torch-sim engine docs
- Inline test helpers into fixtures, convert _make_ni_atoms_2 to fixture
- Update imports: metatomic.torchsim -> metatomic_torchsim
- Remove **kwargs from AtomisticModel.save() (no purpose)
- Update README: reference upet instead of pet-mad
HaoZeke added a commit to CompRhys/metatomic that referenced this pull request Mar 11, 2026
- Restructure as flat metatomic_torchsim package (no namespace shims)
- Rename _calculator.py to _model.py (matches MetatomicModel class)
- Convert all md docs to rst under docs/src/engines/
- Remove separate docs/ directory, wire into main doc toctree
- Add version bounds: metatomic-torch >=0.1.11,<0.2, torch-sim >=0.5,<0.6
- Remove towncrier/tbump config (premature for unreleased package)
- Update URLs to point to torch-sim engine docs
- Inline test helpers into fixtures, convert _make_ni_atoms_2 to fixture
- Update imports: metatomic.torchsim -> metatomic_torchsim
- Remove **kwargs from AtomisticModel.save() (no purpose)
- Update README: reference upet instead of pet-mad
@HaoZeke HaoZeke force-pushed the main branch 12 times, most recently from a4272d0 to 80e1b9c Compare March 12, 2026 17:30
@HaoZeke HaoZeke force-pushed the main branch 3 times, most recently from a8cf071 to b2b4f67 Compare March 12, 2026 17:45
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be in the user documentation? Or should we move it to dev docs (or even just MD or rst files next to the code?)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow up later? We need to do a migration for the other packages, might as well standardize then.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, then I'll remove these files for now and we can add them back in the follow-up.

I'll keep a copy locally in addition to the git history.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be turned into an example in here (https://github.com/metatensor/metatomic/tree/main/python/examples) I think

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a lot more verbose than the documentation we have for ASE ^_^. I'm not against it, but we need to think a bit how to show this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HaoZeke added a commit to HaoZeke/metatomic that referenced this pull request Mar 13, 2026
- Remove support for loading .ckpt files directly
- Remove 'pet-mad' shortcut (requires metatrain)
- Update documentation to point users to upet for model export
- Remove metatrain from optional dependencies

Metatrain checkpoints should now be exported using upet before using
with torchsim: pip install upet && upet export model.ckpt

Addresses review comment from @Luthaf on PR metatensor#167
HaoZeke added a commit to HaoZeke/metatomic that referenced this pull request Mar 13, 2026
- Remove support for loading .ckpt files directly
- Remove 'pet-mad' shortcut (required metatrain)
- Update documentation to point users to upet for model export
- Remove metatrain from optional dependencies

Metatrain checkpoints should now be exported using upet before using
with torchsim: pip install upet && upet export model.ckpt

Addresses review comment from @Luthaf on PR metatensor#167
HaoZeke added a commit to HaoZeke/metatomic that referenced this pull request Mar 13, 2026
- Remove _memory_scales_with attribute (generic statement not needed)
- Remove pytest tool options from pyproject.toml
- Remove torchsim-docs tox environment (docs don't exist)
@CompRhys CompRhys changed the title Upstream metatomic TorchSim model Add torch-sim integration into a separate metatomic-torchsim package Mar 13, 2026
@CompRhys CompRhys changed the title Add torch-sim integration into a separate metatomic-torchsim package Add torch-sim integration as a separate metatomic-torchsim package Mar 13, 2026
@HaoZeke HaoZeke requested a review from Luthaf March 16, 2026 16:24
@Luthaf Luthaf force-pushed the main branch 2 times, most recently from bc365b2 to 2500857 Compare March 17, 2026 10:26
Luthaf
Luthaf previously approved these changes Mar 17, 2026
@Luthaf Luthaf dismissed their stale review March 17, 2026 10:31

Also need to build the wheels on CI

@Luthaf Luthaf force-pushed the main branch 3 times, most recently from 1d01bd8 to f53ce49 Compare March 17, 2026 13:34
@CompRhys
Copy link
Contributor Author

thanks for the great work here guys!

It will hold the TorchSim <=> metatomic integration as a standalone
module.

Co-Authored-By: Rhys Goodall <rhys.goodall@outlook.com>
Co-Authored-By: Guillaume Fraux <guillaume.fraux@epfl.ch>
@Luthaf Luthaf merged commit b5b3598 into metatensor:main Mar 17, 2026
49 checks passed
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.

3 participants