Repository navigation
feat(cli): support LMDB datasets in dp eval-desc and dp embed - #6161
Draft
Lovlace777 wants to merge 1 commit into
Draft
Lovlace777 wants to merge 1 commit into
Lovlace777 wants to merge 1 commit into
Conversation
njzjz-bot
reviewed
Nov 24, 2026
njzjz-bot
left a comment
Contributor
There was a problem hiding this comment.
Agent: dot. The new LMDB paths in both eval-desc and embed can silently discard inputs in a mixed-availability batch. LmdbTestData._stack_frames AND-reduces find_* across the whole same-size group. For example, if one frame provides DPA4C charge_spin=[1,2] and a second frame omits it, both frames are evaluated with the model default. The regression tests cover all-present and all-absent inputs, not this mixed case. Please preserve supplied per-frame values and apply defaults only for missing frames, or reject mixed availability explicitly. This is a source-level finding; I did not run a model reproducer.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6034
Summary
process_systems()discovery andis_lmdb()/LmdbTestData/LmdbTestDataNlocViewdispatch indeepmd/entrypoints/eval_desc.pyanddeepmd/entrypoints/embedding.py, matchingdp test.nlocand mixed-nlocLMDB datasets deterministically without shuffling:nlocLMDB: outputs<basename>.npy(dp eval-desc) and HDF5 group<basename>withsystem=<path>(dp embed) in ascending LMDB storage order.nlocLMDB: partitions frames by ascendingnloc(preserving ascending LMDB storage order within each group) into<basename>_nloc<N>.npy(dp eval-desc) and HDF5 group<basename>_nloc<N>withsystem="<path> [nloc=<N>]"(dp embed)._1,_2, ...) and skip empty LMDBs cleanly with a warning.fparam,aparam,charge_spin) consistently ineval_desc(checkingfind_* != 0.0) sodeepmd/npyanddeepmd/lmdbproduce identical results.deepmd/main.py,doc/inference/embedding.md, anddoc/test/test.md.Verification
source/tests/pt/test_lmdb_eval_desc_embed.py(9 tests) covering:nlocLMDB vsdeepmd/npyparity (reversedtype_map, unused element in LMDBtype_map, unsorted atom order) for bothdp eval-descanddp embed(rtol=1e-12, atol=1e-12).nloc(3, 6, 9 atoms) LMDB deterministic ordering, naming, and numerical parity against equivalentdeepmd/npysystems.deepmd/npy,.lmdb, and plaindata.mdbdirectories, collision de-duplication, source-directory immutability,-f datafileinput, and empty LMDB handling.nopbc),fparam/aparam+ default fallback (se_e2_a),charge_spin+ default fallback (pt_exptdpa4c), anddpdata.MultiSystems.to("deepmd/lmdb")parity.masterwithRuntimeError: Did not find valid system(via-s) andFileNotFoundError: No set.* is found(via-f).pytest source/tests/pt/test_lmdb_eval_desc_embed.py -v->9 passedpytest source/tests/pt/model/test_embedding.py source/tests/pt_expt/infer/test_embedding.py::test_dpa4_command_reads_the_conditions_of_the_system -v->8 passed, 1 skippedruff check,ruff format --check, andisort --checkpass cleanly on all modified/added Python files.