Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
1c583fb
Merge pull request #1805 from amcadmus/devel
amcadmus Jul 1, 2022
78bfbc5
fix typo in hip assert error message (#1802)
njzjz Jul 1, 2022
61107cb
add core api docs (#1800)
njzjz Jul 1, 2022
be7935d
add op docs (#1804)
njzjz Jul 1, 2022
2ea4c78
There's no need for building libtensorflow_cc.so anymore (#1744)
denghuilu Jul 1, 2022
41bf630
improve conda installation in the documentation (#1808)
njzjz Jul 4, 2022
07999c5
fix memory leaking of GraphDef (#1811)
njzjz Jul 6, 2022
8882224
add the missing sstream header (#1817)
njzjz Jul 7, 2022
46139d9
merge CMake test codes via `add_subdirectory` (#1814)
njzjz Jul 11, 2022
93afa25
fix grappler compilation error with TF 1.15 (#1821)
njzjz Jul 13, 2022
6d49973
docs: fix shape of virial (#1824)
njzjz Jul 16, 2022
2f66615
avoid multiple sessions in DeepEval (#1829)
njzjz Jul 24, 2022
3eba354
fix build and running issues on Windows (#1830)
njzjz Jul 27, 2022
a5522e2
comment unused session in DPTabulate (#1834)
njzjz Jul 27, 2022
2a406b1
fix deprecated bare `pair_coeff` (#1838)
njzjz Aug 1, 2022
0010a7e
bump default lammps version to stable_23Jun2022_update1 (#1847)
njzjz Aug 6, 2022
aec488b
error if LAMMPS_VERSION_NUMBER is not defined (#1849)
njzjz Aug 7, 2022
a3cf558
add variant info to output message (#1851)
njzjz Aug 12, 2022
7aea9cf
generate author list from git (#1854)
njzjz Aug 12, 2022
acca2a6
revert prod_force OMP in #1360 (#1862)
njzjz Aug 19, 2022
ee3b01c
lammps plugin: replace v2.0 with actual version (#1863)
njzjz Aug 19, 2022
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
1 change: 1 addition & 0 deletions .github/workflows/test_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,6 @@ jobs:
CC: gcc-${{ matrix.gcc }}
CXX: g++-${{ matrix.gcc }}
TENSORFLOW_VERSION: ${{ matrix.tf }}
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- run: dp --version
- run: pytest --cov=deepmd source/tests && codecov
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ _build
_templates
API_CC
doc/api_py/
doc/api_core/
dp/
dp_test/
dp_test_cc/
Expand Down
8 changes: 5 additions & 3 deletions deepmd/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,15 @@ def get_module(module_name: str) -> "ModuleType":
"""
if platform.system() == "Windows":
ext = ".dll"
prefix = ""
#elif platform.system() == "Darwin":
# ext = ".dylib"
else:
ext = ".so"
prefix = "lib"

module_file = (
(Path(__file__).parent / SHARED_LIB_MODULE / module_name)
(Path(__file__).parent / SHARED_LIB_MODULE / (prefix + module_name))
.with_suffix(ext)
.resolve()
)
Expand Down Expand Up @@ -324,8 +326,8 @@ def _get_package_constants(
TF_VERSION = GLOBAL_CONFIG["tf_version"]
TF_CXX11_ABI_FLAG = int(GLOBAL_CONFIG["tf_cxx11_abi_flag"])

op_module = get_module("libop_abi")
op_grads_module = get_module("libop_grads")
op_module = get_module("op_abi")
op_grads_module = get_module("op_grads")

# FLOAT_PREC
dp_float_prec = os.environ.get("DP_INTERFACE_PREC", "high").lower()
Expand Down
13 changes: 9 additions & 4 deletions deepmd/infer/deep_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ def model_type(self) -> str:
:type:str
"""
t_mt = self._get_tensor("model_attr/model_type:0")
sess = tf.Session(graph=self.graph, config=default_tf_session_config)
[mt] = run_sess(sess, [t_mt], feed_dict={})
[mt] = run_sess(self.sess, [t_mt], feed_dict={})
return mt.decode("utf-8")

@property
Expand All @@ -90,10 +89,16 @@ def model_version(self) -> str:
# For deepmd-kit version 0.x - 1.x, set model version to 0.0
return "0.0"
else:
sess = tf.Session(graph=self.graph, config=default_tf_session_config)
[mt] = run_sess(sess, [t_mt], feed_dict={})
[mt] = run_sess(self.sess, [t_mt], feed_dict={})
return mt.decode("utf-8")

@property
@lru_cache(maxsize=None)
def sess(self) -> tf.Session:
"""Get TF session."""
# start a tf session associated to the graph
return tf.Session(graph=self.graph, config=default_tf_session_config)

def _graph_compatable(
self
) -> bool :
Expand Down
2 changes: 0 additions & 2 deletions deepmd/infer/deep_pot.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ def __init__(
for attr_name, tensor_name in self.tensors.items():
self._get_tensor(tensor_name, attr_name)

# start a tf session associated to the graph
self.sess = tf.Session(graph=self.graph, config=default_tf_session_config)
self._run_default_sess()
self.tmap = self.tmap.decode('UTF-8').split()

Expand Down
2 changes: 0 additions & 2 deletions deepmd/infer/deep_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ def __init__(
self.tensors.update(optional_tensors)
self._support_gfv = True

# start a tf session associated to the graph
self.sess = tf.Session(graph=self.graph, config=default_tf_session_config)
self._run_default_sess()
self.tmap = self.tmap.decode('UTF-8').split()

Expand Down
1 change: 1 addition & 0 deletions deepmd/train/run_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
f"source commit: {GLOBAL_CONFIG['git_hash']}",
f"source commit at: {GLOBAL_CONFIG['git_date']}",
f"build float prec: {global_float_prec}",
f"build variant: {GLOBAL_CONFIG['dp_variant']}",
f"build with tf inc: {GLOBAL_CONFIG['tf_include_dir']}",
f"build with tf lib: {GLOBAL_CONFIG['tf_libs'].replace(';', _sep)}" # noqa
)
Expand Down
7 changes: 6 additions & 1 deletion deepmd/train/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
import os
import glob
import platform
import time
import shutil
import google.protobuf.message
Expand Down Expand Up @@ -574,7 +575,11 @@ def save_checkpoint(self, cur_batch: int):
os.remove(new_ff)
except OSError:
pass
os.symlink(ori_ff, new_ff)
if platform.system() != 'Windows':
# by default one does not have access to create symlink on Windows
os.symlink(ori_ff, new_ff)
else:
shutil.copyfile(ori_ff, new_ff)
log.info("saved checkpoint %s" % self.save_ckpt)

def get_feed_dict(self, batch, is_training):
Expand Down
2 changes: 1 addition & 1 deletion deepmd/utils/tabulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(self,
self.activation_fn = activation_fn

self.graph, self.graph_def = load_graph_def(self.model_file)
self.sess = tf.Session(graph = self.graph)
#self.sess = tf.Session(graph = self.graph)

self.sub_graph, self.sub_graph_def = self._load_sub_graph()
self.sub_sess = tf.Session(graph = self.sub_graph)
Expand Down
Loading