Skip to content

feat(pt): Add Optimized DPA4 Neo inference path using CuTe - #5978

Open
atulcthakur wants to merge 20 commits into
deepmodeling:masterfrom
atulcthakur:accelerate/deepmd-cute
Open

atulcthakur wants to merge 20 commits into
deepmodeling:masterfrom
atulcthakur:accelerate/deepmd-cute

Conversation

@atulcthakur

@atulcthakur atulcthakur commented Aug 17, 2026 •

Copy link
Copy Markdown

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=1

Existing DeepMD inference interfaces remain unchanged. Unsupported model configurations retain the existing implementation. DP_NEO_CUTE_INFER may coexist with DP_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:

  • 1.25x–1.36x lower latency than torch.compile + DP_TRITON_INFER=2
  • 44–50% lower peak GPU allocation, equivalent to a 1.8–2.0x smaller memory footprint

The 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.allclose with shared tolerances on the order of 5e-5.

Summary by CodeRabbit

  • New Features
    • Added optional CuTe-accelerated SeZM inference for supported NVIDIA GPUs, including packed Wigner processing and optimized interaction, embedding, grid-product, and readout paths.
    • Added architecture-aware runtime selection, compilation caching, fallback behavior, and checkpoint-safe cache invalidation.
    • Added optional installation support and configuration documentation for CuTe inference.
  • Bug Fixes
    • Inference now temporarily freezes parameters where required and reliably restores their original gradient settings.
  • Refactor
    • Removed the experimental CuTe SO(2) value-path backend in favor of the newer CuTe inference implementation.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants