docs(train): document stat_file, EMA shadow model, and LMDB datasets
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- numpy, python, pytorch, tensorflow
- Domain
- documentation
Research direction
Read the cited entries in deepmd/utils/argcheck.py, deepmd/tf/model/stat_file.py, deepmd/dpmodel/utils/lmdb_data.py, and deepmd/pt_expt/utils/lmdb_dataset.py, then inspect the data dispatch paths. Update doc/train/training-advanced.md, doc/data/system.md, and doc/train/training.md; run the specified grep checks, with completion shown by accurate defaults, backend restrictions, usage examples, and LMDB pointers.
Written by the indexing model from the issue text.
Description
Parent issue: #5917 (checklist items 10, 12, 16)
Scope
Three training-side features registered in the schema (deepmd/utils/argcheck.py) but lacking prose:
stat_file/stat_file_mode(2b3bb05a7,feat(tf): support training stat_file; implementationdeepmd/tf/model/stat_file.py; schema atargcheck.py:5300-5313,5348-5357): persist data statistics so later trainings skip recomputation.stat_fileselects a.h5/.hdf5HDF5 file or (otherwise) a directory of NumPy binaries;stat_file_modeis PyTorch-only (update= create/write missing stats;read= require an existing complete cache, read-only, safe to share one HDF5 file across training processes). Nothing indoc/train/mentions them.- EMA shadow model (
57f870ff4, PyTorch):enable_ema,ema_decay,ema_ckpt_keep(argcheck.py:5264-5278,5425+). Only a passingema_ckpt_keepmention exists inside theckpt_keep_ratiodescription atdoc/train/training-advanced.md:107. - LMDB training datasets (
565f4beecpt/dpmodel dataloader,54f42d90cpt_expt,9d6381602max/filter mode,a3f548d7bfull-validation lmdb):deepmd/dpmodel/utils/lmdb_data.py(pure Python lmdb/msgpack reader),deepmd/pt_expt/utils/lmdb_dataset.py. Not documented as a training data format indoc/data/ordoc/train/(only as a dpa-adapt conversion target atdoc/dpa_adapt/input_formats.md:105).
Implementation plan
1+2. doc/train/training-advanced.md
- Add a "Data statistics cache (
stat_file)" subsection:- Purpose (avoid re-running neighbor/statistics passes),
stat_filepath semantics (HDF5 vs npy directory by extension), backend support (TensorFlow and PyTorch — verify TF support fromdeepmd/tf/model/stat_file.py), and a minimal JSON example under thetrainingsection; stat_file_mode(updatedefault /read), PyTorch-only, parallel-training use case.
- Purpose (avoid re-running neighbor/statistics passes),
- Add an "Exponential moving average (EMA) of parameters" subsection:
enable_ema(PyTorch only),ema_decay(document default from argcheck), the_ema-suffixed periodic checkpoints,ema_ckpt_keepretention, interaction withckpt_keep_ratio; how to consume an EMA checkpoint (verify whether freeze/test can take it directly fromdeepmd/pt/entrypoints).
3. LMDB datasets — doc/data/system.md (+ pointer from doc/train/training.md)
Read deepmd/dpmodel/utils/lmdb_data.py, deepmd/pt_expt/utils/lmdb_dataset.py, and how training_data.systems entries are dispatched (e.g. deepmd/pt/data_utils/, deepmd/utils/data_system.py) before writing.
- In
doc/data/system.md, add LMDB to the supported data system formats:- which backends support it (PyTorch, PyTorch-Exportable, DP — verify; note TF does not if that is the case);
- on-disk layout/metadata expectations as implemented (msgpack-serialized entries, metadata keys, type map storage — keep it concise and accurate);
- how to point
training_data.systems/validation_data.systemsat an LMDB directory (verify path detection logic — suffix or directory marker); - how to produce LMDB datasets (link
doc/dpa_adapt/input_formats.mdconversion route).
- In
doc/train/training.md, add one sentence near the DataSystem summary paragraph noting LMDB systems are also accepted on supported backends (cross-ref the data docs).
Constraints
- Verify defaults and backend support from code (argcheck entries and dataloader dispatch) — several of these are backend-restricted; state restrictions explicitly.
- Keep JSON snippets minimal and valid (
check-jsonruns in pre-commit only for repo files, not docs, but stay valid).
Verification
grep -n "stat_file" doc/train/training-advanced.mdandgrep -n -i "ema" doc/train/training-advanced.mdshow new subsections.grep -n -i "lmdb" doc/data/system.md doc/train/training.mdshows the new format docs.
Parent issue: #5917
Coding agent: opencode
opencode version: 1.18.9
Model: ustc/k3
Reasoning effort: max
- Dominant language
- Python
- Stars
- 2.1k
- Forks
- 663
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 25
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from deepmodeling/deepmd-kit
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
deepmodeling/deepmd-kit#6086 ·
Maintainers usually reply within 3 days
-
Fine-tune descriptor mismatch warning should ignore seedPossibly taken @SiyuanChenToDo claimed this 23 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
deepmodeling/deepmd-kit#6038 · 2 comments ·
Maintainers usually reply within 3 days
-
Docs enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
deepmodeling/deepmd-kit#5766 · 1 comment ·
Maintainers usually reply within 3 days
-
branch: master lang: py todo comment type: todo
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
deepmodeling/deepmd-kit#5480 ·
Maintainers usually reply within 3 days
-
branch: master lang: toml todo comment type: todo
Difficulty 1/5 Under an hour Newbie friendliness 72/100
deepmodeling/deepmd-kit#5462 ·
Maintainers usually reply within 3 days
All issues in deepmodeling/deepmd-kit
Similar issues
-
documentation good first issue priority: P2 status: ready
Difficulty 1/5 Under an hour Newbie friendliness 88/100
RhinoLink-Tech/data-fabric#500 ·
Maintainers usually reply within 1 day
-
backlog
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
EchoTools/nevr-runtime#2384 ·
Maintainers usually reply within 1 day
-
[Bug]: The H2 series' and the H3C's fan 3 is labelled "Chamber Fan", Bambu calls it the exhaust fanOpenarea:ui
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
btclib-org/btclib#3062 ·
Maintainers usually reply within 1 day
-
area:evals area:infra enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
jse-avl/support-bot#4 · 1 comment ·