Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ The `"type" : "dp"` tell the traning method is {dargs:argument}`"dp" <train>`, i
The `"config"` key defines the training configs, see {ref}`the full documentation<train[dp]/config>`.
The {dargs:argument}`"template_script" <train[dp]/template_script>` provides the template training script in `json` format.

#### DeePMD backend and model compression

The training `config.impl` value selects the DeePMD-kit backend used by DPGEN2. Checkpoint, frozen-model, and compression formats are backend-specific: a PyTorch `.pt`/`.pth` file is not a TensorFlow GraphDef, so running `dp compress` without the PyTorch backend flag on that file produces a protobuf parsing error.

Compression support also depends on the installed DeePMD-kit version. DeePMD-kit 3.0.0b3 supports compression only for the TensorFlow backend; its `dp --pt` command has no `compress` subcommand. In that environment, deploy the uncompressed PyTorch frozen model or train/freeze a compatible TensorFlow model. For another version, verify support with that installation's `dp --pt --help` before attempting compression and use only the syntax and model formats documented for that backend. DPGEN2 cannot add a compression capability that the selected DeePMD-kit runtime does not provide.


### Exploration

Expand Down
6 changes: 5 additions & 1 deletion dpgen2/op/run_dp_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,11 @@ def decide_init_model(
@staticmethod
def training_args():
doc_command = "The command for DP, 'dp' for default"
doc_impl = "The implementation/backend of DP. It can be 'tensorflow' or 'pytorch'. 'tensorflow' for default."
doc_impl = (
"The DeePMD-kit training backend: 'tensorflow' or 'pytorch'. "
"Backend-specific post-processing commands and capabilities, such "
"as model compression, depend on the installed DeePMD-kit version."
)
doc_init_model_policy = "The policy of init-model training. It can be\n\n\
- 'no': No init-model training. Traing from scratch.\n\n\
- 'yes': Do init-model training.\n\n\
Expand Down