Commit 480509a
perf(pt): DPA4-family performance optimizations (#6001)
## Summary
- accelerate SeZM/DPA4 inference with tuned Triton kernels, fused cuTile
and CUDA paths, and lower projection overhead
- bring the accelerated inference and force-loss training paths to the
`pt_expt` backend while keeping common tensor math in `dpmodel`
- add fused DPA4C CPU/CUDA graph execution, including graph
construction, fitting, force, and virial paths
- reduce distributed-training overhead and capture the HybridMuon update
in a CUDA graph
- keep unsupported layouts, distributed precompile, and CPU-traced
exports on explicit reference or target-aware fallback seams
## Performance
On the documented RTX PRO 6000 Blackwell workloads:
- an 8,000-atom DPA4-mini force step improves from 5.72 ms to 4.28 ms;
the compiled package improves from 6.03 ms to 4.40 ms
- the fused CUDA lower graph improves from 117.5 ms to 74.0 ms and
reduces peak memory from 15.4 GiB to 11.2 GiB
- the same inference tuning improves the 48,640-atom force step by 1.30x
and raises the measured 48 GiB capacity ceiling from about 40,000 to
48,640 atoms
The kernel levels remain opt-in and target-aware. Unsupported shapes and
devices retain the reference implementations.
## Validation
- `git diff --check upstream/master..HEAD`
- `ruff check` on all 154 changed Python files
- CPU array-API and DPA4C paths: 72 passed, 3 skipped
- CUDA serialization kernel-level policy: 11 passed
- PT and PT-expt accelerated training paths: 12 passed
- HybridMuon and cuTile paths: 42 passed, 12 subtests passed
- CPU-trace-to-CUDA fast-op export and AOT package paths: 4 passed
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added accelerated DPA4/SeZM computation across CUDA, Triton, cuTile,
and CPU.
* Added CPU cell-based neighbor-graph construction and improved CSR
handling.
* Added optimized scalar-only readout and projection paths.
* Added CUDA graph capture, training graph precompilation, and
configurable compilation.
* Added cross-backend einsum support and improved accelerator selection.
* Preserved trainable radial-basis settings during serialization.
* **Bug Fixes**
* Corrected source-atom virial attribution and improved empty-graph and
masked-edge handling.
* Preserved autograd when moving arrays between devices.
* **Documentation**
* Expanded guidance for accelerated DPA4/DPA4C inference, export
settings, precision, and hardware compatibility.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent b32f74c commit 480509a
259 files changed
Lines changed: 49355 additions & 6520 deletions
File tree
- deepmd
- dpmodel
- descriptor
- dpa4_nn
- loss
- utils/neighbor_graph
- kernels
- cuda
- triton/sezm
- pt_expt
- descriptor
- dpa4_nn
- fitting
- infer
- kernels
- cuda
- dpa1
- dpa4
- cute
- sezm
- cutile
- sezm
- dpa4c
- triton
- dpa1
- sezm
- model
- train
- utils
- pt
- entrypoints
- model
- descriptor
- sezm_nn
- model
- optimizer
- train
- utils
- utils
- doc/model
- source
- api_cc
- include
- src
- tests
- op/pt
- cpu
- dpa4c
- dpa4
- rotate_mix_train
- so2_conv_train
- tests
- common
- dpmodel
- consistent
- pt_expt
- descriptor
- infer
- kernels
- model
- utils
- pt
- model
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
46 | 51 | | |
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
51 | 60 | | |
52 | 61 | | |
53 | 62 | | |
| |||
111 | 120 | | |
112 | 121 | | |
113 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
114 | 259 | | |
115 | 260 | | |
116 | 261 | | |
| |||
0 commit comments