Skip to content

Added DeePMD-kit PyTorch backend integration - #604

Open
rahulumrao wants to merge 3 commits into
TorchSim:mainfrom
rahulumrao:deepmd_torchsim
Open

Added DeePMD-kit PyTorch backend integration#604
rahulumrao wants to merge 3 commits into
TorchSim:mainfrom
rahulumrao:deepmd_torchsim

Conversation

@rahulumrao

@rahulumrao rahulumrao commented Sep 1, 2026

Copy link
Copy Markdown

Summary

  • Feature 1
  • Fix 1

Checklist

Before a pull request can be merged, the following items must be checked:

  • Doc strings have been added in the Google docstring format.
  • Run ruff on your code.
  • Tests have been added for any new functionality or bug fixes.

Comment thread docs/reference/deepmd.rst Outdated
Comment thread pyproject.toml Outdated
# phono3py>=4.0.0: some older 3.x sdists (e.g. 3.2.0) fail to build and break uv resolution.
mattersim = ["mattersim>=1.2.5", "phono3py>=4.0.0"]
metatomic = ["metatomic-torchsim>=0.1.1", "metatomic-ase>=0.1.0", "upet>=0.2.0"]
deepmd = ["deepmd_torchsim>=0.1.1"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

make sure to capture any deps clashes below.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Verified dependency compatibility, the added deepmd = ["deepmd_torchsim>=0.1.1"] doesn't introduce any conflicts. Because deepmd_torchsim is a thin wrapper that places no direct constraints on deepmd-kit or torch, it won't clash with the other extras.

I intentionally leave deepmd-kit out of the direct dependencies since its PyTorch backend requires specific, torch versions. Offloading those constraints to deepmd_torchsim own deepmd extra keeps torch-sim's dependency tree clean and decoupled.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please pin a minimum version that works such that all someone would need to do if importing from top level is install the right option. Otherwise there's no benefit to having the ease of use first party import now we adopted an external model posture

In terms of clashes please check once you've pinned a minimum working set which models deepmd can solve the deps alongside and mark the uv clashes in the pyproject toml. This is also important for UX who use TS for interfacing to many models.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done! torch-sim[deepmd] now installs deepmd-kit==3.1.3 with torch==2.10.0. All model extras work with deepmd except fairchem, which has a PyTorch version conflict. Added fairchem to the conflicts list.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We have standard testing approach for models and their interfaces. Using that infrastructure is a prerequisite to merging here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Rewritten on the standard infrastructure and now pushed into GitHub. Test used the DPA-3.1-3M universal model, and passed all 22/22 test locally.

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.

2 participants