From 33a54c24f07468ac0af789f171ed411c5b560e96 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sun, 27 Oct 2024 22:46:20 -0400 Subject: [PATCH] revert Signed-off-by: Jinzhe Zeng --- deepmd/tf/nvnmd/entrypoints/wrap.py | 12 ++++++------ doc/model/dplr.md | 2 +- examples/data_conv/OUTCAR | 12 ++++++------ examples/water/dplr/lmp/in.lammps | 4 ++-- source/lmp/tests/test_dplr.py | 12 ++++++------ source/tests/pt/model/test_dpa1.py | 12 ++++++------ source/tests/pt/model/test_se_atten_v2.py | 12 ++++++------ source/tests/tf/test_data_large_batch.py | 6 +++--- source/tests/tf/test_descrpt_hybrid.py | 4 ++-- source/tests/tf/test_type_one_side.py | 12 ++++++------ 10 files changed, 44 insertions(+), 44 deletions(-) diff --git a/deepmd/tf/nvnmd/entrypoints/wrap.py b/deepmd/tf/nvnmd/entrypoints/wrap.py index 69077ca752..7811f90f75 100755 --- a/deepmd/tf/nvnmd/entrypoints/wrap.py +++ b/deepmd/tf/nvnmd/entrypoints/wrap.py @@ -116,16 +116,16 @@ def wrap(self): # extend data according to the number of bits per row of BRAM nbit = 32 if nvnmd_cfg.version == 0: - data = [hcfg, hfps, hbps, hswt, hdsw, hfea, hgra] + datas = [hcfg, hfps, hbps, hswt, hdsw, hfea, hgra] keys = "cfg fps bps swt dsw fea gra".split() if nvnmd_cfg.version == 1: keys = "cfg fps bps swt dsw std fea gra gtt avc".split() - data = [hcfg, hfps, hbps, hswt, hdsw, hstd, hfea, hgra, hgtt, havc] + datas = [hcfg, hfps, hbps, hswt, hdsw, hstd, hfea, hgra, hgtt, havc] nhs = [] nws = [] - for ii in range(len(data)): + for ii in range(len(datas)): k = keys[ii] - d = data[ii] + d = datas[ii] h = len(d) w = len(d[0]) # nhex w4 = w * 4 # nbit @@ -138,7 +138,7 @@ def wrap(self): if jdata_sys["debug"]: log.info("%s: %d x % d bit" % (k, h, w * 4)) FioTxt().save(f"nvnmd/wrap/h{k}.txt", d) - data[ii] = d + datas[ii] = d # update h & w of nvnmd_cfg nvnmd_cfg.size["NH_DATA"] = nhs nvnmd_cfg.size["NW_DATA"] = nws @@ -146,7 +146,7 @@ def wrap(self): head = self.wrap_head(nhs, nws) # output model hs = [*head] - for d in data: + for d in datas: hs.extend(d) FioBin().save(self.model_file, hs) diff --git a/doc/model/dplr.md b/doc/model/dplr.md index 838350e024..91c2251346 100644 --- a/doc/model/dplr.md +++ b/doc/model/dplr.md @@ -168,7 +168,7 @@ pair_style deepmd ener.pb pair_coeff * * bond_style zero bond_coeff * -special_bonds lj/could 1 1 1 angle no +special_bonds lj/coul 1 1 1 angle no ``` Type 1 and 2 (O and H) are `real_atom`s, while type 3 (WCs) are `virtual_atom`s. The model file `ener.pb` stores both the DW and DPLR models, so the position of WCs and the energy can be inferred from it. A virtual bond type is specified by `bond_style zero`. The `special_bonds` command switches off the exclusion of intramolecular interactions. diff --git a/examples/data_conv/OUTCAR b/examples/data_conv/OUTCAR index 3eacd478c4..15041df5f0 100644 --- a/examples/data_conv/OUTCAR +++ b/examples/data_conv/OUTCAR @@ -39,7 +39,7 @@ LEXCH = PE EATOM = 432.3788 eV, 31.7789 Ry - TITLE = PAW_PBE O_h 06Feb2004 + TITEL = PAW_PBE O_h 06Feb2004 LULTRA = F use ultrasoft PP ? IUNSCR = 1 unscreen: 0-lin 1-nonlin 2-no RPACOR = 0.800 partial core radius @@ -93,7 +93,7 @@ LEXCH = PE EATOM = 12.4884 eV, 0.9179 Ry - TITLE = PAW_PBE H_h 06Feb2004 + TITEL = PAW_PBE H_h 06Feb2004 LULTRA = F use ultrasoft PP ? IUNSCR = 0 unscreen: 0-lin 1-nonlin 2-no RPACOR = 0.000 partial core radius @@ -297,8 +297,8 @@ Space group operators: Intra band minimization: WEIMIN = 0.0000 energy-eigenvalue tresh-hold - EBREAK = 0.16E-09 absolute break condition - DEPER = 0.30 relative break condition + EBREAK = 0.16E-09 absolut break condition + DEPER = 0.30 relativ break condition TIME = 0.40 timestep for ELM @@ -339,7 +339,7 @@ Space group operators: KINTER = 0 interpolate to denser k-point grid CSHIFT =0.1000 complex shift for real part using Kramers Kronig OMEGAMAX= -1.0 maximum frequency - DEG_THRESHOLD= 0.2000000E-02 threshold for treating states as degenerate + DEG_THRESHOLD= 0.2000000E-02 threshold for treating states as degnerate RTIME = -0.100 relaxation time in fs (WPLASMAI= 0.000 imaginary part of plasma frequency in eV, 0.658/RTIME) DFIELD = 0.0000000 0.0000000 0.0000000 field for delta impulse in time @@ -2475,7 +2475,7 @@ Space group operators: - General timing and accounting information for this job: + General timing and accounting informations for this job: ======================================================== Total CPU time used (sec): 877.816 diff --git a/examples/water/dplr/lmp/in.lammps b/examples/water/dplr/lmp/in.lammps index fe8d799633..4b5b09f8b2 100644 --- a/examples/water/dplr/lmp/in.lammps +++ b/examples/water/dplr/lmp/in.lammps @@ -6,7 +6,7 @@ variable KMESH equal 32 variable THERMO_FREQ equal 2 variable DUMP_FREQ equal 20 variable TEMP equal 300.000000 -variable PRESS equal 1.000000 +variable PRES equal 1.000000 variable TAU_T equal 0.100000 variable TAU_P equal 0.500000 @@ -33,7 +33,7 @@ pair_style deepmd ener.pb pair_coeff * * bond_style zero bond_coeff * -special_bonds lj/could 1 1 1 angle no +special_bonds lj/coul 1 1 1 angle no # kspace_style "pppm/dplr" should be used. in addition the # gewald(1/distance) should be set the same as that used in diff --git a/source/lmp/tests/test_dplr.py b/source/lmp/tests/test_dplr.py index 28a573613f..2dd3531894 100644 --- a/source/lmp/tests/test_dplr.py +++ b/source/lmp/tests/test_dplr.py @@ -384,7 +384,7 @@ def test_pair_deepmd_lr(lammps): lammps.pair_coeff("* *") lammps.bond_style("zero") lammps.bond_coeff("*") - lammps.special_bonds("lj/could 1 1 1 angle no") + lammps.special_bonds("lj/coul 1 1 1 angle no") lammps.kspace_style("pppm/dplr 1e-5") lammps.kspace_modify(f"gewald {beta:.2f} diff ik mesh {mesh:d} {mesh:d} {mesh:d}") lammps.fix(f"0 all dplr model {pb_file.resolve()} type_associate 1 3 bond_type 1") @@ -410,7 +410,7 @@ def test_pair_deepmd_lr_efield_constant(lammps): lammps.pair_coeff("* *") lammps.bond_style("zero") lammps.bond_coeff("*") - lammps.special_bonds("lj/could 1 1 1 angle no") + lammps.special_bonds("lj/coul 1 1 1 angle no") lammps.fix( f"0 all dplr model {pb_file.resolve()} type_associate 1 3 bond_type 1 efield 0 0 1" ) @@ -446,7 +446,7 @@ def test_pair_deepmd_lr_efield_variable(lammps): lammps.pair_coeff("* *") lammps.bond_style("zero") lammps.bond_coeff("*") - lammps.special_bonds("lj/could 1 1 1 angle no") + lammps.special_bonds("lj/coul 1 1 1 angle no") lammps.fix( f"0 all dplr model {pb_file.resolve()} type_associate 1 3 bond_type 1 efield 0 0 v_EFIELD_Z" ) @@ -481,7 +481,7 @@ def test_min_dplr(lammps): lammps.pair_coeff("* *") lammps.bond_style("zero") lammps.bond_coeff("*") - lammps.special_bonds("lj/could 1 1 1 angle no") + lammps.special_bonds("lj/coul 1 1 1 angle no") lammps.kspace_style("pppm/dplr 1e-5") lammps.kspace_modify(f"gewald {beta:.2f} diff ik mesh {mesh:d} {mesh:d} {mesh:d}") lammps.fix(f"0 all dplr model {pb_file.resolve()} type_associate 1 3 bond_type 1") @@ -505,7 +505,7 @@ def test_pair_deepmd_lr_type_map(lammps_type_map): lammps_type_map.pair_coeff("* * H O") lammps_type_map.bond_style("zero") lammps_type_map.bond_coeff("*") - lammps_type_map.special_bonds("lj/could 1 1 1 angle no") + lammps_type_map.special_bonds("lj/coul 1 1 1 angle no") lammps_type_map.kspace_style("pppm/dplr 1e-5") lammps_type_map.kspace_modify( f"gewald {beta:.2f} diff ik mesh {mesh:d} {mesh:d} {mesh:d}" @@ -535,7 +535,7 @@ def test_pair_deepmd_lr_si(lammps_si): lammps_si.pair_coeff("* *") lammps_si.bond_style("zero") lammps_si.bond_coeff("*") - lammps_si.special_bonds("lj/could 1 1 1 angle no") + lammps_si.special_bonds("lj/coul 1 1 1 angle no") lammps_si.kspace_style("pppm/dplr 1e-5") lammps_si.kspace_modify( f"gewald {beta / constants.dist_metal2si:.6e} diff ik mesh {mesh:d} {mesh:d} {mesh:d}" diff --git a/source/tests/pt/model/test_dpa1.py b/source/tests/pt/model/test_dpa1.py index 4fbbd5c20a..d168ceb2ae 100644 --- a/source/tests/pt/model/test_dpa1.py +++ b/source/tests/pt/model/test_dpa1.py @@ -42,7 +42,7 @@ def test_consistency( dstd = rng.normal(size=(self.nt, nnei, 4)) dstd = 0.1 + np.abs(dstd) - for idt, sm, to, tm, prec, etc in itertools.product( + for idt, sm, to, tm, prec, ect in itertools.product( [False, True], # resnet_dt [False, True], # smooth_type_embedding [False, True], # type_one_side @@ -68,8 +68,8 @@ def test_consistency( smooth_type_embedding=sm, type_one_side=to, tebd_input_mode=tm, - use_econf_tebd=etc, - type_map=["O", "H"] if etc else None, + use_econf_tebd=ect, + type_map=["O", "H"] if ect else None, seed=GLOBAL_SEED, ).to(env.DEVICE) dd0.se_atten.mean = torch.tensor(davg, dtype=dtype, device=env.DEVICE) @@ -117,7 +117,7 @@ def test_jit( dstd = rng.normal(size=(self.nt, nnei, 4)) dstd = 0.1 + np.abs(dstd) - for idt, prec, sm, to, tm, etc in itertools.product( + for idt, prec, sm, to, tm, ect in itertools.product( [ False, ], # resnet_dt @@ -145,8 +145,8 @@ def test_jit( smooth_type_embedding=sm, type_one_side=to, tebd_input_mode=tm, - use_econf_tebd=etc, - type_map=["O", "H"] if etc else None, + use_econf_tebd=ect, + type_map=["O", "H"] if ect else None, seed=GLOBAL_SEED, ) dd0.se_atten.mean = torch.tensor(davg, dtype=dtype, device=env.DEVICE) diff --git a/source/tests/pt/model/test_se_atten_v2.py b/source/tests/pt/model/test_se_atten_v2.py index b73a848f5c..462b2aca34 100644 --- a/source/tests/pt/model/test_se_atten_v2.py +++ b/source/tests/pt/model/test_se_atten_v2.py @@ -42,7 +42,7 @@ def test_consistency( dstd = rng.normal(size=(self.nt, nnei, 4)) dstd = 0.1 + np.abs(dstd) - for idt, to, prec, etc in itertools.product( + for idt, to, prec, ect in itertools.product( [False, True], # resnet_dt [False, True], # type_one_side [ @@ -64,8 +64,8 @@ def test_consistency( precision=prec, resnet_dt=idt, type_one_side=to, - use_econf_tebd=etc, - type_map=["O", "H"] if etc else None, + use_econf_tebd=ect, + type_map=["O", "H"] if ect else None, seed=GLOBAL_SEED, ).to(env.DEVICE) dd0.se_atten.mean = torch.tensor(davg, dtype=dtype, device=env.DEVICE) @@ -113,7 +113,7 @@ def test_jit( dstd = rng.normal(size=(self.nt, nnei, 4)) dstd = 0.1 + np.abs(dstd) - for idt, prec, to, etc in itertools.product( + for idt, prec, to, ect in itertools.product( [ False, ], # resnet_dt @@ -135,8 +135,8 @@ def test_jit( precision=prec, resnet_dt=idt, type_one_side=to, - use_econf_tebd=etc, - type_map=["O", "H"] if etc else None, + use_econf_tebd=ect, + type_map=["O", "H"] if ect else None, seed=GLOBAL_SEED, ) dd0.se_atten.mean = torch.tensor(davg, dtype=dtype, device=env.DEVICE) diff --git a/source/tests/tf/test_data_large_batch.py b/source/tests/tf/test_data_large_batch.py index 63f1cff760..d9bb00de40 100644 --- a/source/tests/tf/test_data_large_batch.py +++ b/source/tests/tf/test_data_large_batch.py @@ -186,7 +186,7 @@ def test_data_mixed_type(self): sess.run(tf.global_variables_initializer()) [e, f, v] = sess.run([energy, force, virial], feed_dict=feed_dict_test) # print(sess.run(model.type_embedding)) - # np.savetxt('tmp.out', sess.run(descrpt.doubt, feed_dict = feed_dict_test), fmt='%.10e') + # np.savetxt('tmp.out', sess.run(descrpt.dout, feed_dict = feed_dict_test), fmt='%.10e') # # print(sess.run(model.atype_embed, feed_dict = feed_dict_test)) # print(sess.run(fitting.inputs, feed_dict = feed_dict_test)) # print(sess.run(fitting.outs, feed_dict = feed_dict_test)) @@ -386,7 +386,7 @@ def test_stripped_data_mixed_type(self): sess.run(tf.global_variables_initializer()) [e, f, v] = sess.run([energy, force, virial], feed_dict=feed_dict_test) # print(sess.run(model.type_embedding)) - # np.savetxt('tmp.out', sess.run(descrpt.doubt, feed_dict = feed_dict_test), fmt='%.10e') + # np.savetxt('tmp.out', sess.run(descrpt.dout, feed_dict = feed_dict_test), fmt='%.10e') # # print(sess.run(model.atype_embed, feed_dict = feed_dict_test)) # print(sess.run(fitting.inputs, feed_dict = feed_dict_test)) # print(sess.run(fitting.outs, feed_dict = feed_dict_test)) @@ -586,7 +586,7 @@ def test_compressible_data_mixed_type(self): sess.run(tf.global_variables_initializer()) [e, f, v] = sess.run([energy, force, virial], feed_dict=feed_dict_test) # print(sess.run(model.type_embedding)) - # np.savetxt('tmp.out', sess.run(descrpt.doubt, feed_dict = feed_dict_test), fmt='%.10e') + # np.savetxt('tmp.out', sess.run(descrpt.dout, feed_dict = feed_dict_test), fmt='%.10e') # # print(sess.run(model.atype_embed, feed_dict = feed_dict_test)) # print(sess.run(fitting.inputs, feed_dict = feed_dict_test)) # print(sess.run(fitting.outs, feed_dict = feed_dict_test)) diff --git a/source/tests/tf/test_descrpt_hybrid.py b/source/tests/tf/test_descrpt_hybrid.py index 222f833d97..cadf2f83ae 100644 --- a/source/tests/tf/test_descrpt_hybrid.py +++ b/source/tests/tf/test_descrpt_hybrid.py @@ -88,7 +88,7 @@ def test_descriptor_hybrid(self): type_embedding = typeebd.build(ntypes, suffix="_hybrid") - doubt = descrpt.build( + dout = descrpt.build( t_coord, t_type, t_natoms, @@ -115,7 +115,7 @@ def test_descriptor_hybrid(self): sess = self.cached_session().__enter__() sess.run(tf.global_variables_initializer()) - [model_dout] = sess.run([doubt], feed_dict=feed_dict_test) + [model_dout] = sess.run([dout], feed_dict=feed_dict_test) ref_dout1 = [ 1.34439289e-03, diff --git a/source/tests/tf/test_type_one_side.py b/source/tests/tf/test_type_one_side.py index 0c96ee1ad6..2ab7cc03a7 100644 --- a/source/tests/tf/test_type_one_side.py +++ b/source/tests/tf/test_type_one_side.py @@ -69,7 +69,7 @@ def test_descriptor_one_side_exclude_types(self): # successful descrpt = Descriptor(**jdata["model"]["descriptor"]) - doubt = descrpt.build( + dout = descrpt.build( t_coord, t_type, t_natoms, @@ -125,8 +125,8 @@ def test_descriptor_one_side_exclude_types(self): with self.cached_session() as sess: sess.run(tf.global_variables_initializer()) - [model_dout1] = sess.run([doubt], feed_dict=feed_dict_test1) - [model_dout2] = sess.run([doubt], feed_dict=feed_dict_test2) + [model_dout1] = sess.run([dout], feed_dict=feed_dict_test1) + [model_dout2] = sess.run([dout], feed_dict=feed_dict_test2) [model_dout1_failed] = sess.run([dout_failed], feed_dict=feed_dict_test1) [model_dout2_failed] = sess.run([dout_failed], feed_dict=feed_dict_test2) model_dout1 = model_dout1.reshape([6, -1]) @@ -175,7 +175,7 @@ def test_se_r_one_side_exclude_types(self): # successful descrpt = Descriptor(**jdata["model"]["descriptor"]) - doubt = descrpt.build( + dout = descrpt.build( t_coord, t_type, t_natoms, @@ -231,8 +231,8 @@ def test_se_r_one_side_exclude_types(self): with self.cached_session() as sess: sess.run(tf.global_variables_initializer()) - [model_dout1] = sess.run([doubt], feed_dict=feed_dict_test1) - [model_dout2] = sess.run([doubt], feed_dict=feed_dict_test2) + [model_dout1] = sess.run([dout], feed_dict=feed_dict_test1) + [model_dout2] = sess.run([dout], feed_dict=feed_dict_test2) [model_dout1_failed] = sess.run([dout_failed], feed_dict=feed_dict_test1) [model_dout2_failed] = sess.run([dout_failed], feed_dict=feed_dict_test2) model_dout1 = model_dout1.reshape([6, -1])