Skip to content

Commit

Permalink
Merge branch 'deepmd-v3' into fix-dp-optim-parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzyphysics committed Mar 29, 2024
2 parents 0e04dbe + 1c12011 commit e6c9022
Show file tree
Hide file tree
Showing 4 changed files with 866 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dpgen2/entrypoint/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,11 @@ def workflow_concurrent_learning(
valid_data = config["inputs"]["valid_data_sys"]
if valid_data is not None:
valid_data_prefix = config["inputs"]["valid_data_prefix"]
valid_data = [valid_data] if isinstance(valid_data, str) else valid_data
assert isinstance(valid_data, list)
if valid_data_prefix is not None:
valid_data = [os.path.join(valid_data_prefix, ii) for ii in valid_data]
if isinstance(valid_data, str):
valid_data = expand_sys_str(valid_data)
valid_data = [expand_sys_str(ii) for ii in valid_data]
valid_data = upload_artifact(valid_data)
concurrent_learning_op = make_concurrent_learning_op(
train_style,
Expand Down Expand Up @@ -543,10 +544,11 @@ def workflow_concurrent_learning(
multi_init_data_idx = {}
for k, v in multi_init_data.items():
sys = v["sys"]
if isinstance(sys, str):
sys = expand_sys_str(sys)
sys = [sys] if isinstance(sys, str) else sys
assert isinstance(sys, list)
if v["prefix"] is not None:
sys = [os.path.join(v["prefix"], ii) for ii in sys]
sys = [expand_sys_str(ii) for ii in sys]
istart = len(init_data)
init_data += sys
iend = len(init_data)
Expand Down
198 changes: 198 additions & 0 deletions examples/water/input_distill.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
{
"name": "water-distill",
"bohrium_config": {
"username": "",
"password": "",
"project_id": 1,
"_comment": "all"
},
"default_step_config": {
"template_config": {
"image": "",
"_comment": "all"
},
"_comment": "all"
},
"step_configs": {
"run_train_config": {
"template_config": {
"image": "",
"_comment": "all"
},
"executor": {
"type": "dispatcher",
"retry_on_submission_error": 10,
"image_pull_policy": "IfNotPresent",
"machine_dict": {
"batch_type": "Bohrium",
"context_type": "Bohrium",
"remote_profile": {
"input_data": {
"job_type": "container",
"platform": "ali",
"scass_type": "1 * NVIDIA V100_16g"
}
}
}
},
"_comment": "all"
},
"run_explore_config": {
"template_config": {
"image": "",
"_comment": "all"
},
"continue_on_success_ratio": 0.80,
"executor": {
"type": "dispatcher",
"retry_on_submission_error": 10,
"image_pull_policy": "IfNotPresent",
"machine_dict": {
"batch_type": "Bohrium",
"context_type": "Bohrium",
"remote_profile": {
"input_data": {
"job_type": "container",
"platform": "ali",
"scass_type": "1 * NVIDIA V100_16g"
}
}
}
},
"template_slice_config": {
"group_size": 5,
"pool_size": 1
},
"_comment": "all"
},
"run_fp_config": {
"template_config": {
"image": "",
"_comment": "all"
},
"continue_on_success_ratio": 0.80,
"executor": {
"type": "dispatcher",
"retry_on_submission_error": 10,
"image_pull_policy": "IfNotPresent",
"machine_dict": {
"batch_type": "Bohrium",
"context_type": "Bohrium",
"remote_profile": {
"input_data": {
"job_type": "container",
"platform": "ali",
"scass_type": "1 * NVIDIA V100_16g"
}
}
}
},
"template_slice_config": {
"group_size": 500,
"pool_size": 1
},
"_comment": "all"
},
"_comment": "all"
},
"upload_python_packages": [
"/path/to/dpgen2"
],
"inputs": {
"type_map": [
"O",
"H"
],
"mixed_type": true,
"mass_map": [
16.0,
4.0
],
"init_data_prefix": null,
"init_data_sys": [
"train_predict/data_0",
"train_predict/data_1",
"train_predict/data_2"
],
"valid_data_sys": [
"valid_predict/data_3"
],
"_comment": "all"
},
"train": {
"type": "dp",
"numb_models": 4,
"config": {
"init_model_policy": "yes",
"init_model_old_ratio": 0.90,
"init_model_numb_steps": 500000,
"init_model_start_lr": 1e-4,
"init_model_start_pref_e": 0.25,
"init_model_start_pref_f": 100,
"_comment": "all"
},
"template_script": "train.json",
"_comment": "all"
},
"explore": {
"type": "lmp",
"config": {
"command": "lmp -var restart 0"
},
"convergence": {
"type": "adaptive-lower",
"conv_tolerance": 0.005,
"_numb_candi_f": 3000,
"rate_candi_f": 0.15,
"level_f_hi": 0.5,
"n_checked_steps": 8,
"_command": "all"
},
"max_numb_iter": 16,
"fatal_at_max": false,
"configuration_prefix": null,
"configurations": [
{
"type": "file",
"files": [
"init"
],
"fmt": "deepmd/npy/mixed"
}
],
"stages": [
[
{
"type": "lmp-template",
"lmp": "template.lammps",
"trj_freq": 100,
"revisions": {
"V_NSTEPS": [
100
],
"V_TEMP": [
330
],
"V_DUMPFREQ": [
200
]
},
"sys_idx": [
0
],
"n_sample": 4
}
]
],
"_comment": "all"
},
"fp": {
"type": "deepmd",
"task_max": 4000,
"run_config" : {
"teacher_model_path": "teacher_model.pt"
},
"inputs_config": {},
"_comment": "all"
}
}
Loading

0 comments on commit e6c9022

Please sign in to comment.