From b8e1c396b8e70e53025fbf3dcc65472848357726 Mon Sep 17 00:00:00 2001 From: njzjz-bot Date: Mon, 24 Aug 2026 04:09:01 +0800 Subject: [PATCH] docs: clarify PyTorch compression support Explain backend-specific model formats and the DeePMD-kit 3.0.0b3 limitation that leaves PyTorch compression unavailable. Coding-Agent: Codex Codex-Version: codex-cli 0.149.1 Model: gpt-5.6-sol Reasoning-Effort: xhigh --- docs/input.md | 6 ++++++ dpgen2/op/run_dp_train.py | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/input.md b/docs/input.md index 6fc03bd1..ab961631 100644 --- a/docs/input.md +++ b/docs/input.md @@ -59,6 +59,12 @@ The `"type" : "dp"` tell the traning method is {dargs:argument}`"dp" `, i The `"config"` key defines the training configs, see {ref}`the full documentation`. The {dargs:argument}`"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 diff --git a/dpgen2/op/run_dp_train.py b/dpgen2/op/run_dp_train.py index c0cf2d4d..61743154 100644 --- a/dpgen2/op/run_dp_train.py +++ b/dpgen2/op/run_dp_train.py @@ -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\