deepmd.dpmodel.train.entrypoint#

Backend-independent training entrypoint pipeline.

Attributes#

Classes#

TrainEntrypointOptions

Common command options for backend train entrypoints.

AbstractTrainEntrypoint

Shared pipeline for backend train entrypoints.

Module Contents#

deepmd.dpmodel.train.entrypoint.log[source]#
class deepmd.dpmodel.train.entrypoint.TrainEntrypointOptions[source]#

Common command options for backend train entrypoints.

input_file: str[source]#
output: str = 'out.json'[source]#
init_model: str | None = None[source]#
restart: str | None = None[source]#
init_frz_model: str | None = None[source]#
finetune: str | None = None[source]#
model_branch: str = ''[source]#
use_pretrain_script: bool = False[source]#
skip_neighbor_stat: bool = False[source]#
class deepmd.dpmodel.train.entrypoint.AbstractTrainEntrypoint[source]#

Bases: abc.ABC

Shared pipeline for backend train entrypoints.

Backend subclasses keep ownership of backend-specific feature handling, neighbor-stat updates, distributed setup, data construction, and trainer construction. This pipeline only coordinates the common command flow.

run(options: TrainEntrypointOptions) None[source]#

Run the training entrypoint.

prepare_options(options: TrainEntrypointOptions) TrainEntrypointOptions[source]#

Normalize command options before reading or preprocessing config.

load_config(input_file: str) dict[str, Any][source]#

Load the JSON/YAML training config.

validate_options(config: dict[str, Any], options: TrainEntrypointOptions) None[source]#

Validate backend feature support before mutating the config.

preprocess_config(config: dict[str, Any], options: TrainEntrypointOptions) dict[str, Any][source]#

Apply backend-specific config preprocessing before argcheck.

is_multi_task(config: dict[str, Any]) bool[source]#

Return whether the config is in multi-task layout.

update_input(config: dict[str, Any]) dict[str, Any][source]#

Apply DeePMD input-version compatibility conversion.

normalize_config(config: dict[str, Any], *, multi_task: bool) dict[str, Any][source]#

Run DeePMD argcheck normalization.

update_neighbor_stat(config: dict[str, Any], options: TrainEntrypointOptions, *, multi_task: bool) tuple[dict[str, Any], Any][source]#

Update descriptor selections from neighbor statistics.

dump_config(config: dict[str, Any], output: str) None[source]#

Dump the normalized config used for training.

print_summary() None[source]#

Print backend summary information.

setup_run(options: TrainEntrypointOptions, config: dict[str, Any]) None[source]#

Set up backend runtime state before trainer execution.

teardown_run(options: TrainEntrypointOptions, config: dict[str, Any]) None[source]#

Tear down backend runtime state after trainer execution.

abstractmethod run_training(config: dict[str, Any], options: TrainEntrypointOptions, neighbor_stat: Any) None[source]#

Build backend data/trainer objects and run training.