Skip to content

[pull] master from deepmodeling:master - #307

Merged
pull[bot] merged 2 commits into
ishandutta2007:masterfrom
deepmodeling:master
Aug 4, 2026
Merged

[pull] master from deepmodeling:master#307
pull[bot] merged 2 commits into
ishandutta2007:masterfrom
deepmodeling:master

Conversation

@pull

@pull pull Bot commented Aug 4, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

OutisLi and others added 2 commits August 4, 2026 07:56
## Summary

- evaluate `dp test` in atom-bounded chunks, with lazy on-demand
decoding for LMDB inputs
- preserve run-level MAE/RMSE aggregation and detail output across
chunks while consolidating backend-independent test logic under
`deepmd.infer.model_test`
- build the neighbor representation declared by each atomic model during
output-bias statistics, using `NeighborGraph` for graph-native models
and the existing dense neighbor list for other models

## Why

Large LMDB datasets were fully decoded before frame selection, so even a
small test run could require loading tens of millions of frames.
Separately, graph-native atomic models were routed through a
fixed-capacity dense neighbor list while calibrating output bias;
because those models do not declare a finite neighbor capacity, that
path could allocate tens of gigabytes and fail before fine-tuning began.

This change bounds LMDB decoding and model-evaluation memory while
preserving the existing evaluation and output-statistics contracts.
Ordinary `DeepmdData` inputs still materialize one test system before
chunked evaluation.

## Additional correctness fixes

- preserve legacy TensorFlow spin-model dispatch and spin virial/stress
reporting
- use canonical atomic tensor labels consistently across NPY and LMDB
inputs
- flatten atomic parameters correctly for graph-native output statistics
- keep LMDB frame selection deterministic and honor availability
subgroups during iteration
- keep detail files isolated across systems and emit a single header
across chunks
- require atomic property labels when atomic metrics are requested

## Checks

- `ruff check .`
- `ruff format --check .`
- targeted common model-test and LMDB regression tests
- targeted PyTorch streaming/output-stat regression tests
- `git diff --check`

The TensorFlow atomic dipole/polar integration cases could not be run
locally because this checkout has no built TensorFlow backend; they are
left to CI.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Expanded model evaluation for energy, spin, DOS, property, dipole, and
polarizability models.
* Added chunked testing, frame limits, per-frame details, and
atomic-level metrics.
* **Improvements**
* Large LMDB test datasets now load frames lazily for improved
efficiency.
  * Added clearer weighted aggregation of MAE and RMSE results.
* Graph-capable models now use graph-based neighbor representations
during inference.
* **Bug Fixes**
* Improved handling of periodic systems, mixed atom counts, exclusions,
optional outputs, missing labels, and atomic label naming.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Closes #5665.

## Summary

- centralize remapping of negative virtual atom types to the reserved
final row of padded embedding tables
- apply the same pair-index convention across dpmodel, pt_expt, legacy
PyTorch, and Paddle DPA1/DPA2/SE_T implementations
- keep real-type-only exclusion and normalization tables on a separate
clamp-to-real convention
- use the shared remapping helper in SeZMTypeEmbedding
- cover DPA1 virtual neighbors inside the cutoff, DPA2, both DPA3
local-mapping branches, pt_expt pair arithmetic, and legacy PyTorch
descriptors

## Sentinel convention

Only tables explicitly constructed with a final padding row may use
ntypes as the remapped virtual type. Real-type-only tables such as davg,
dstd, exclusion inputs, and spin masks must instead receive masked or
clamped real-type indices. TypeEmbedNet reconstructs a literal zero
padding row; SeZMTypeEmbedding reserves and initializes its stored final
row to zero.

## Validation

- focused virtual-type and backend regressions: 15 passed
- DPA1 graph parity plus the existing DPA2 descriptor tests: 18 passed
- pt_expt DPA1 export tests: 8 passed
- changed-file ruff check: passed
- ruff format .: passed
- git diff --check: passed
- Paddle-specific code was statically checked but could not be executed
locally because Paddle is not installed
- full ruff check . still reports five unrelated pre-existing findings
in deepmd/jax/jax_md/__init__.py and deepmd/tf/entrypoints/__init__.py

Coding agent: Codex
Codex version: codex-cli 0.144.6
Model: gpt-5.6-sol
Reasoning effort: xhigh

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added consistent padding-aware type-embedding handling across dense,
graph, and accelerated descriptor calculations.
- Virtual or negative atom types now map safely to the designated
padding embedding.

- **Bug Fixes**
- Prevented incorrect embedding lookups and invalid type indexing across
supported execution paths.
- Ensured virtual types produce results equivalent to explicit padding
types.

- **Tests**
- Added regression coverage across NumPy, PyTorch, descriptor modes, and
embedding pathways.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: njzjz-bot <njzjz.bot@gmail.com>
Co-authored-by: njzjz-bot <njzjz-bot@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@pull pull Bot locked and limited conversation to collaborators Aug 4, 2026
@pull pull Bot added the ⤵️ pull label Aug 4, 2026
@pull
pull Bot merged commit c0c1f0c into ishandutta2007:master Aug 4, 2026
@github-actions github-actions Bot added the Python label Aug 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants