Repository navigation
feat(pt): Add Optimized DPA4 Neo inference path using CuTe - #5978
Open
atulcthakur wants to merge 20 commits into
Open
atulcthakur wants to merge 20 commits into
atulcthakur wants to merge 20 commits into
Conversation
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
This PR adds an opt-in, strict-FP32 CuTe DSL inference path for supported DPA4-Neo models.
The implementation accelerates SO(2) message passing and related operations used for energy, force, and stress inference. It includes architecture-aware dispatch for Ampere, Ada, Hopper, and Blackwell GPUs, automatic edge preparation, optional CuTe dependencies, and correctness and compile-integration tests.
Usage
Install the optional dependencies:
pip install "deepmd-kit[torch,cute]"Enable the complete Neo CuTe path before constructing or exporting the model:
export DP_NEO_CUTE_INFER=1Existing DeepMD inference interfaces remain unchanged. Unsupported model configurations retain the existing implementation.
DP_NEO_CUTE_INFERmay coexist withDP_TRITON_INFER=2.Performance
For a strict-FP32, 3,072-atom water energy/force/stress workload, including neighbor-list construction, the CuTe path provides approximately:
torch.compile + DP_TRITON_INFER=2The reported range covers measurements on NVIDIA A100, L40S, H100, and RTX PRO 6000 Blackwell GPUs.
Correctness
Energy, force, atomic-energy, and virial outputs were compared against eager PyTorch. The optimized path passes
torch.allclosewith shared tolerances on the order of5e-5.Summary by CodeRabbit