Skip to content

[Feature Request] Support different backends for DeePMD-kit #1462

@njzjz

Description

@njzjz

Summary

Support PyTorch backend for DeePMD-kit.

Detailed Description

Although I have submitted deepmodeling/deepmd-kit#3191 to make most of the things the same, the suffixes of the model and checkpoint files are different by design. These suffixes are hardcoded in the code.

backward_files = ["frozen_model.pb", "lcurve.out", "train.log"]
backward_files += [
"model.ckpt.meta",
"model.ckpt.index",
"model.ckpt.data-00000-of-00001",
"checkpoint",
]
if jdata.get("dp_compress", False):
backward_files.append("frozen_model_compressed.pb")

if not jdata.get("dp_compress", False):
model_name = "frozen_model.pb"
else:
model_name = "frozen_model_compressed.pb"
task_file = os.path.join(train_task_fmt % ii, model_name)
ofile = os.path.join(work_path, "graph.%03d.pb" % ii)

all_models = glob.glob(os.path.join(work_path, "graph*pb"))

models = glob.glob(os.path.join(train_path, "graph*pb"))

Besides, glob doesn't work for backward_files - in dpdispatcher, some contexts like Bohrium don't support it.
So, may we consider adding a parameter to switch?

Further Information, Files, and Links

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions