Commit 87cb6ef
authored
fix: remove hessian outdef if not necessary (#5045)
I found that the inference time per atom very weird using small models
(both DPA3-L3 and DPA1 attn0) on very large systems (more than 1000
atoms):
<img width="1034" height="695" alt="截屏2025-11-11 17 52 32"
src="https://github.com/user-attachments/assets/71b12719-ee74-4f2b-bb50-9f5f7031ee16"
/>
Through profilling, I found some unnecessary memory allocation matters
for keys not in the model outputs (such as hessian).
After fix, the inference time seems good:
<img width="1067" height="693" alt="截屏2025-11-11 17 56 26"
src="https://github.com/user-attachments/assets/0fe6d430-3daa-43cd-b245-0889cd1311a8"
/>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Refactor**
* Improved internal handling of output definitions in model inference to
ensure proper filtering for models without Hessian support.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 877147e commit 87cb6ef
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
400 | | - | |
| 400 | + | |
401 | 401 | | |
402 | | - | |
| 402 | + | |
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
414 | 421 | | |
415 | 422 | | |
416 | 423 | | |
| |||
0 commit comments