Commit 5cc4c57
fix(dpmodel): forward spin inputs in DeepEval (#5852)
Closes #5661.
## Summary
- normalize and validate spin inputs before automatic batching so
flattened multi-frame inputs are sliced with their coordinate frames
- forward extra model inputs through the dpmodel `DeepEval` adapter
while keeping evaluator-owned inputs canonical
- retain the magnetic-atom mask in non-atomic `DeepPot` results
- add public-API regressions for forced one-frame batching and missing
spin inputs
## Why existing tests missed this
Existing dpmodel spin tests exercised direct model calls and
serialization parity, not the `DeepEval` adapter. Public spin inference
coverage targeted the PyTorch and PT2 backends, which already have
dedicated spin forwarding paths. Those fixtures were also primarily
single-frame, so they would not detect a flat spin tensor being left
unsliced when automatic batching splits a multi-frame evaluation.
## Validation
- `pytest source/tests/infer/test_dpmodel_deep_eval_spin.py -q` (2
passed)
-
`source/tests/common/test_auto_batch_size.py::TestAutoBatchSize::test_execute_all`
(passed)
- dpmodel non-spin `DeepEval` smoke evaluation (passed)
- `ruff format .` (1664 files unchanged)
- `ruff check .` (passed)
- `git diff --check` (passed)
Coding agent: Codex
Codex version: codex-cli 0.144.4
Model: gpt-5.6-sol
Reasoning effort: xhigh
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved inference handling for spin-enabled models, including
validation and consistent batching of spin data.
* Preserved optional charge and spin inputs during evaluation.
* Ensured non-atomic evaluations include magnetic mask output when
applicable.
* Prevented unsupported inputs from being passed to models that do not
use them.
* **Tests**
* Added regression coverage for spin input batching, required spin data,
and irrelevant input handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: njzjz-bot <njzjz.bot@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: njzjz-bot <njzjz-bot@users.noreply.github.com>1 parent f573ca0 commit 5cc4c57
2 files changed
Lines changed: 158 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
243 | 267 | | |
244 | 268 | | |
245 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
246 | 276 | | |
247 | 277 | | |
248 | 278 | | |
| |||
287 | 317 | | |
288 | 318 | | |
289 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
290 | 326 | | |
291 | 327 | | |
292 | 328 | | |
| |||
342 | 378 | | |
343 | 379 | | |
344 | 380 | | |
| 381 | + | |
345 | 382 | | |
346 | 383 | | |
347 | 384 | | |
| |||
370 | 407 | | |
371 | 408 | | |
372 | 409 | | |
373 | | - | |
374 | | - | |
375 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
376 | 413 | | |
377 | 414 | | |
378 | 415 | | |
379 | 416 | | |
380 | 417 | | |
| 418 | + | |
381 | 419 | | |
382 | 420 | | |
383 | 421 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
0 commit comments