Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bump the upper bound of deepmd version #1691

Merged
merged 1 commit into from
Dec 23, 2024
Merged
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
8 changes: 4 additions & 4 deletions dpgen/generator/arginfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ def model_devi_jobs_args() -> list[Argument]:
doc_taup = "Coupling time of barostat (ps)."
doc_model_devi_f_trust_lo = "Lower bound of forces for the selection. If dict, should be set for each index in sys_idx, respectively."
doc_model_devi_f_trust_hi = "Upper bound of forces for the selection. If dict, should be set for each index in sys_idx, respectively."
doc_model_devi_v_trust_lo = "Lower bound of virial for the selection. If dict, should be set for each index in sys_idx, respectively. Should be used with DeePMD-kit v2.x."
doc_model_devi_v_trust_hi = "Upper bound of virial for the selection. If dict, should be set for each index in sys_idx, respectively. Should be used with DeePMD-kit v2.x."
doc_model_devi_v_trust_lo = "Lower bound of virial for the selection. If dict, should be set for each index in sys_idx, respectively. Should be used with DeePMD-kit v2 or above."
doc_model_devi_v_trust_hi = "Upper bound of virial for the selection. If dict, should be set for each index in sys_idx, respectively. Should be used with DeePMD-kit v2 or above."

args = [
model_devi_jobs_template_args(),
Expand Down Expand Up @@ -351,8 +351,8 @@ def model_devi_lmp_args() -> list[Argument]:
doc_model_devi_skip = "Number of structures skipped for fp in each MD."
doc_model_devi_f_trust_lo = "Lower bound of forces for the selection. If list or dict, should be set for each index in sys_configs, respectively."
doc_model_devi_f_trust_hi = "Upper bound of forces for the selection. If list or dict, should be set for each index in sys_configs, respectively."
doc_model_devi_v_trust_lo = "Lower bound of virial for the selection. If list or dict, should be set for each index in sys_configs, respectively. Should be used with DeePMD-kit v2.x."
doc_model_devi_v_trust_hi = "Upper bound of virial for the selection. If list or dict, should be set for each index in sys_configs, respectively. Should be used with DeePMD-kit v2.x."
doc_model_devi_v_trust_lo = "Lower bound of virial for the selection. If list or dict, should be set for each index in sys_configs, respectively. Should be used with DeePMD-kit v2 or above."
doc_model_devi_v_trust_hi = "Upper bound of virial for the selection. If list or dict, should be set for each index in sys_configs, respectively. Should be used with DeePMD-kit v2 or above."
doc_model_devi_adapt_trust_lo = (
"Adaptively determines the lower trust levels of force and virial. This option should be used together with model_devi_numb_candi_f, model_devi_numb_candi_v and optionally with model_devi_perc_candi_f and model_devi_perc_candi_v. dpgen will make two sets:\n\n\
- 1. From the frames with force model deviation lower than model_devi_f_trust_hi, select max(model_devi_numb_candi_f, model_devi_perc_candi_f*n_frames) frames with largest force model deviation. \n\n\
Expand Down
16 changes: 8 additions & 8 deletions dpgen/generator/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@
raise RuntimeError("invalid setting for use_ele_temp " + str(use_ele_temp))
elif Version(mdata["deepmd_version"]) >= Version("2") and Version(
mdata["deepmd_version"]
) < Version("3"):
) < Version("4"):
# 2.x
jinput["training"].setdefault("training_data", {})
jinput["training"]["training_data"]["systems"] = init_data_sys
Expand All @@ -497,7 +497,7 @@
raise RuntimeError("invalid setting for use_ele_temp " + str(use_ele_temp))
else:
raise RuntimeError(
"DP-GEN currently only supports for DeePMD-kit 1.x or 2.x version!"
"DP-GEN currently only supports for DeePMD-kit 1.x to 3.x version!"
)
# set training reuse model
if auto_ratio:
Expand All @@ -522,7 +522,7 @@
1.0 - training_reuse_old_ratio,
)
)
elif Version("2") <= Version(mdata["deepmd_version"]) < Version("3"):
elif Version("2") <= Version(mdata["deepmd_version"]) < Version("4"):

Check warning on line 525 in dpgen/generator/run.py

View check run for this annotation

Codecov / codecov/patch

dpgen/generator/run.py#L525

Added line #L525 was not covered by tests
jinput["training"]["training_data"]["auto_prob"] = (
"prob_sys_size; 0:%d:%f; %d:%d:%f" # noqa: UP031
% (
Expand Down Expand Up @@ -571,7 +571,7 @@
# set random seed for each model
if Version(mdata["deepmd_version"]) >= Version("1") and Version(
mdata["deepmd_version"]
) < Version("3"):
) < Version("4"):
# 1.x
if "descriptor" not in jinput["model"]:
pass
Expand All @@ -595,7 +595,7 @@
jinput["training"]["seed"] = random.randrange(sys.maxsize) % (2**32)
else:
raise RuntimeError(
"DP-GEN currently only supports for DeePMD-kit 1.x or 2.x version!"
"DP-GEN currently only supports for DeePMD-kit 1.x to 3.x version!"
)
# set model activation function
if model_devi_activation_func is not None:
Expand Down Expand Up @@ -785,7 +785,7 @@
commands = []
if Version(mdata["deepmd_version"]) >= Version("1") and Version(
mdata["deepmd_version"]
) < Version("3"):
) < Version("4"):
# 1.x
## Commands are like `dp train` and `dp freeze`
## train_command should not be None
Expand Down Expand Up @@ -818,7 +818,7 @@
commands.append(f"{train_command} compress")
else:
raise RuntimeError(
"DP-GEN currently only supports for DeePMD-kit 1.x or 2.x version!"
"DP-GEN currently only supports for DeePMD-kit 1.x to 3.x version!"
)

# _tasks = [os.path.basename(ii) for ii in all_task]
Expand Down Expand Up @@ -1695,7 +1695,7 @@
# only support for deepmd v2.0
if Version(mdata["deepmd_version"]) < Version("2.0"):
raise RuntimeError(
"Only support deepmd-kit 2.x for model_devi_engine='gromacs'"
"Only support deepmd-kit v2 or above for model_devi_engine='gromacs'"
)
model_devi_jobs = jdata["model_devi_jobs"]
if iter_index >= len(model_devi_jobs):
Expand Down
Loading