From 44fffaabc3eaa1413b9851416c97e15aa6f8b65d Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Fri, 29 Mar 2024 20:02:41 +0800 Subject: [PATCH] chore: add example --- .../{train.json => dp_dpa1_train.json} | 0 examples/calypso/dpa2_train.json | 96 ++++++ examples/calypso/input.test.json | 303 ++++++++++++++++-- 3 files changed, 370 insertions(+), 29 deletions(-) rename examples/calypso/{train.json => dp_dpa1_train.json} (100%) create mode 100644 examples/calypso/dpa2_train.json diff --git a/examples/calypso/train.json b/examples/calypso/dp_dpa1_train.json similarity index 100% rename from examples/calypso/train.json rename to examples/calypso/dp_dpa1_train.json diff --git a/examples/calypso/dpa2_train.json b/examples/calypso/dpa2_train.json new file mode 100644 index 00000000..e6019597 --- /dev/null +++ b/examples/calypso/dpa2_train.json @@ -0,0 +1,96 @@ +{ + "_comment": "that's all", + "model": { + "type_map": [ + "Mg", + "Al" + ], + "descriptor": { + "type": "dpa2", + "tebd_dim": 8, + "repinit_rcut": 9.0, + "repinit_rcut_smth": 8.0, + "repinit_nsel": 120, + "repformer_rcut": 4.0, + "repformer_rcut_smth": 3.5, + "repformer_nsel": 40, + "repinit_neuron": [ + 25, + 50, + 100 + ], + "repinit_axis_neuron": 12, + "repinit_activation": "tanh", + "repformer_nlayers": 12, + "repformer_g1_dim": 128, + "repformer_g2_dim": 32, + "repformer_attn2_hidden": 32, + "repformer_attn2_nhead": 4, + "repformer_attn1_hidden": 128, + "repformer_attn1_nhead": 4, + "repformer_axis_dim": 4, + "repformer_update_h2": false, + "repformer_update_g1_has_conv": true, + "repformer_update_g1_has_grrg": true, + "repformer_update_g1_has_drrd": true, + "repformer_update_g1_has_attn": true, + "repformer_update_g2_has_g1g1": true, + "repformer_update_g2_has_attn": true, + "repformer_attn2_has_gate": true, + "repformer_add_type_ebd_to_seq": false + }, + "fitting_net": { + "neuron": [ + 240, + 240, + 240 + ], + "resnet_dt": true, + "seed": 1, + "_comment": " that's all" + }, + "_comment": " that's all" + }, + "learning_rate": { + "type": "exp", + "decay_steps": 5000, + "start_lr": 0.0002, + "stop_lr": 3.51e-08, + "_comment": "that's all" + }, + "loss": { + "type": "ener", + "start_pref_e": 0.02, + "limit_pref_e": 1, + "start_pref_f": 1000, + "limit_pref_f": 1, + "start_pref_v": 0, + "limit_pref_v": 0, + "_comment": " that's all" + }, + "training": { + "stat_file": "./dpa2", + "training_data": { + "systems": [ + "/personal/workplace/DP/dpgen2/Mg12Al8/deepmd" + ], + "batch_size": 1, + "_comment": "that's all" + }, + "_validation_data": { + "systems": [ + "/personal/workplace/DP/dpgen2/Mg12Al8/deepmd" + ], + "batch_size": 1, + "_comment": "that's all" + }, + "numb_steps": 20, + "warmup_steps": 0, + "gradient_max_norm": 5.0, + "seed": 10, + "disp_file": "lcurve.out", + "disp_freq": 100, + "save_freq": 200, + "_comment": "that's all" + } +} diff --git a/examples/calypso/input.test.json b/examples/calypso/input.test.json index 12bdfabe..6c745f02 100644 --- a/examples/calypso/input.test.json +++ b/examples/calypso/input.test.json @@ -1,8 +1,8 @@ { "bohrium_config": { - "username": "your@email", - "password": "your_passwd", - "project_id": 00000, + "username": "x@x.cn", + "password": "xxx", + "project_id": 111111, "_host": "https://workflow.dp.tech/", "_k8s_api_server": "https://workflows.deepmodeling.com", "_repo_key": "oss-bohrium", @@ -10,7 +10,7 @@ }, "default_step_config": { "template_config": { - "image": "registry.dp.tech/dptech/prod-11265/dpgen2-calypso:v3", + "image": "registry.dp.tech/dptech/prod-11265/deepmdv3-dpgen2-calypso:v0.2", "_comment": "all" }, "executor": { @@ -33,7 +33,7 @@ "step_configs": { "run_train_config": { "template_config": { - "image": "registry.dp.tech/dptech/prod-11265/dpgen2-calypso:v3", + "image": "registry.dp.tech/dptech/prod-11265/deepmdv3-dpgen2-calypso:v0.2", "_comment": "all" }, "executor": { @@ -47,8 +47,7 @@ "input_data": { "job_type": "container", "platform": "ali", - "_scass_type": "1 * NVIDIA V100_16g", - "scass_type": "c16_m64_cpu" + "scass_type": "1 * NVIDIA V100_32g" } } } @@ -61,9 +60,10 @@ }, "run_explore_config": { "template_config": { - "image": "registry.dp.tech/dptech/prod-11265/dpgen2-calypso:v3", + "image": "registry.dp.tech/dptech/prod-11265/deepmdv3-dpgen2-calypso:v0.2", "_comment": "all" }, + "_continue_on_success_ratio": 0.8, "executor": { "type": "dispatcher", "retry_on_submission_error": 10, @@ -75,13 +75,13 @@ "input_data": { "job_type": "container", "platform": "ali", - "scass_type": "c16_m64_cpu" + "scass_type": "1 * NVIDIA T4_16g" } } } }, - "_template_slice_config": { - "group_size": 50, + "template_slice_config": { + "group_size": 2, "pool_size": 1 }, "_comment": "all" @@ -116,31 +116,276 @@ }, "_comment": "all" }, - "upload_python_packages": [ - "/root/dpgen2/dpgen2" + "_upload_python_packages": [ + "/root/dpgen2/dpgen2", + "/opt/re_e_bias_new/deepmd-kit/deepmd", + "/root/dflow/src/dflow" ], "inputs": { + "mixed_type": true, + "do_finetune": true, "type_map": [ + "H", + "He", + "Li", + "Be", + "B", + "C", + "N", + "O", + "F", + "Ne", + "Na", "Mg", - "Al" + "Al", + "Si", + "P", + "S", + "Cl", + "Ar", + "K", + "Ca", + "Sc", + "Ti", + "V", + "Cr", + "Mn", + "Fe", + "Co", + "Ni", + "Cu", + "Zn", + "Ga", + "Ge", + "As", + "Se", + "Br", + "Kr", + "Rb", + "Sr", + "Y", + "Zr", + "Nb", + "Mo", + "Tc", + "Ru", + "Rh", + "Pd", + "Ag", + "Cd", + "In", + "Sn", + "Sb", + "Te", + "I", + "Xe", + "Cs", + "Ba", + "La", + "Ce", + "Pr", + "Nd", + "Pm", + "Sm", + "Eu", + "Gd", + "Tb", + "Dy", + "Ho", + "Er", + "Tm", + "Yb", + "Lu", + "Hf", + "Ta", + "W", + "Re", + "Os", + "Ir", + "Pt", + "Au", + "Hg", + "Tl", + "Pb", + "Bi", + "Po", + "At", + "Rn", + "Fr", + "Ra", + "Ac", + "Th", + "Pa", + "U", + "Np", + "Pu", + "Am", + "Cm", + "Bk", + "Cf", + "Es", + "Fm", + "Md", + "No", + "Lr", + "Rf", + "Db", + "Sg", + "Bh", + "Hs", + "Mt", + "Ds", + "Rg", + "Cn", + "Nh", + "Fl", + "Mc", + "Lv", + "Ts", + "Og" ], "mass_map": [ - 24, - 27 + 4.0, + 4.0026, + 6.94, + 9.0122, + 10.81, + 12.011, + 14.007, + 15.999, + 18.998, + 20.18, + 22.99, + 24.305, + 26.982, + 28.0855, + 30.974, + 32.06, + 35.45, + 39.95, + 39.098, + 40.078, + 44.956, + 47.867, + 50.942, + 51.996, + 54.938, + 55.845, + 58.933, + 58.693, + 63.546, + 65.38, + 69.723, + 72.63, + 74.922, + 78.971, + 79.904, + 83.798, + 85.468, + 87.62, + 88.906, + 91.224, + 92.906, + 95.95, + 97, + 101.07, + 102.91, + 106.42, + 107.87, + 112.41, + 114.82, + 118.71, + 121.76, + 127.6, + 126.9, + 131.29, + 132.91, + 137.33, + 138.91, + 140.12, + 140.91, + 144.24, + 145, + 150.36, + 151.96, + 157.25, + 158.93, + 162.5, + 164.93, + 167.26, + 168.93, + 173.05, + 174.97, + 178.49, + 180.95, + 183.84, + 186.21, + 190.23, + 192.22, + 195.08, + 196.97, + 200.59, + 204.38, + 207.2, + 208.98, + 209, + 210, + 222, + 223, + 226, + 227, + 232.04, + 231.04, + 238.03, + 237, + 244, + 243, + 247, + 247, + 251, + 252, + 257, + 258, + 259, + 262, + 267, + 268, + 269, + 270, + 269, + 277, + 281, + 282, + 285, + 286, + 290, + 290, + 293, + 294, + 294 ], "init_data_prefix": null, "init_data_sys": [ - "/personal/workplace/DP/dpgen2/Mg12Al8/deepmd" + "/personal/workplace/DP/dpgen2/Mg10Al54/deepmd" ], "_comment": "all" }, "train": { "type": "dp", + "numb_models": 4, + "init_models_paths": [ + "model-ckpt-new.pt", + "model-ckpt-new.pt", + "model-ckpt-new.pt", + "model-ckpt-new.pt" + ], "config": { + "impl":"pytorch", + "finetune_args":"--model-branch Domains_Alloy", "init_model_policy": "yes", - "init_model_old_ratio": 0.5, - "init_model_numb_steps": 20000, - "init_model_start_lr": 1e-4, + "init_model_old_ratio": 0.9, + "init_model_numb_steps": 20, + "init_model_start_lr": 2e-5, "init_model_start_pref_e": 0.25, "init_model_start_pref_f": 100, "_comment": "all" @@ -171,7 +416,7 @@ "config": { "_command": "lmp -var restart 0", "run_calypso_command": "calypso.x", - "run_opt_command": "python -u calypso_run_opt.py" + "run_opt_command": "python -u calypso_run_opt.py model.ckpt.pt" }, "convergence": { "type": "fixed-levels", @@ -207,8 +452,8 @@ "atomic_number": [ 3 ], - "pop_size": 5, - "max_step": 2, + "pop_size": 50, + "max_step": 3, "distance_of_ions": [ [ 1.0 @@ -229,8 +474,8 @@ 3, 37 ], - "pop_size": 5, - "max_step": 2, + "pop_size": 50, + "max_step": 3, "distance_of_ions": [ [ 1.0, @@ -255,8 +500,8 @@ "atomic_number": [ 3 ], - "pop_size": 5, - "max_step": 2, + "pop_size": 50, + "max_step": 3, "distance_of_ions": [ [ 1.0 @@ -277,8 +522,8 @@ 3, 37 ], - "pop_size": 5, - "max_step": 2, + "pop_size": 50, + "max_step": 3, "distance_of_ions": [ [ 1.0,