Skip to content

Commit

Permalink
Merge branch 'devel' into ruff-format
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz authored Oct 30, 2023
2 parents 3132f1e + 1429e46 commit b7f2ce4
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_cc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
# TODO: remove ase version when ase has new release
- run: |
python -m pip install -U pip
python -m pip install -e .[cpu,test,lmp] "ase @ https://github.com/rosswhitfield/ase/archive/edd03571aff6944b77b4a4b055239f3c3e4eeb66.zip"
python -m pip install -e .[cpu,test,lmp] "ase @ https://gitlab.com/ase/ase/-/archive/8c5aa5fd6448c5cfb517a014dccf2b214a9dfa8f/ase-8c5aa5fd6448c5cfb517a014dccf2b214a9dfa8f.tar.gz"
env:
DP_BUILD_TESTING: 1
- run: pytest --cov=deepmd source/lmp/tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Set PyPI mirror for Aliyun cloud machine
run: python -m pip config --user set global.index-url https://mirrors.aliyun.com/pypi/simple/
- run: python -m pip install -U "pip>=21.3.1,!=23.0.0"
- run: python -m pip install -v -e .[gpu,test,lmp,cu11] "ase @ https://github.com/rosswhitfield/ase/archive/edd03571aff6944b77b4a4b055239f3c3e4eeb66.zip"
- run: python -m pip install -v -e .[gpu,test,lmp,cu11] "ase @ https://gitlab.com/ase/ase/-/archive/8c5aa5fd6448c5cfb517a014dccf2b214a9dfa8f/ase-8c5aa5fd6448c5cfb517a014dccf2b214a9dfa8f.tar.gz"
env:
DP_BUILD_TESTING: 1
DP_VARIANT: cuda
Expand Down
10 changes: 5 additions & 5 deletions backend/find_tensorflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ def get_tf_requirement(tf_version: str = "") -> dict:

extra_requires = []
extra_select = {}
if not (tf_version == "" or tf_version in SpecifierSet(">=2.12")):
if not (tf_version == "" or tf_version in SpecifierSet(">=2.12", prereleases=True)):
extra_requires.append("protobuf<3.20")
if tf_version == "" or tf_version in SpecifierSet(">=1.15"):
if tf_version == "" or tf_version in SpecifierSet(">=1.15", prereleases=True):
extra_select["mpi"] = [
"horovod",
"mpi4py",
Expand All @@ -138,9 +138,9 @@ def get_tf_requirement(tf_version: str = "") -> dict:
],
**extra_select,
}
elif tf_version in SpecifierSet("<1.15") or tf_version in SpecifierSet(
">=2.0,<2.1"
):
elif tf_version in SpecifierSet(
"<1.15", prereleases=True
) or tf_version in SpecifierSet(">=2.0,<2.1", prereleases=True):
return {
"cpu": [
f"tensorflow=={tf_version}",
Expand Down
5 changes: 4 additions & 1 deletion deepmd/utils/tabulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ def __init__(
# functype
if activation_fn == ACTIVATION_FN_DICT["tanh"]:
self.functype = 1
elif activation_fn == ACTIVATION_FN_DICT["gelu"]:
elif activation_fn in (
ACTIVATION_FN_DICT["gelu"],
ACTIVATION_FN_DICT["gelu_tf"],
):
self.functype = 2
elif activation_fn == ACTIVATION_FN_DICT["relu"]:
self.functype = 3
Expand Down
7 changes: 7 additions & 0 deletions examples/infer_water/convert_model.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
#include "deepmd/c_api.h"

int main() {
DP_ConvertPbtxtToPb("../../source/tests/infer/deeppot.pbtxt", "graph.pb");
return 0;
}
4 changes: 2 additions & 2 deletions source/install/docker_test_package_c.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ SCRIPT_PATH=$(dirname $(realpath -s $0))

# assume libdeepmd_c.tar.gz has been created

wget "https://drive.google.com/uc?export=download&id=1xldLhzm4uSkq6iPohSycNWAsWqKAenKX" -O ${SCRIPT_PATH}/../../examples/infer_water/"graph.pb"

docker run --rm -v ${SCRIPT_PATH}/../..:/root/deepmd-kit -w /root/deepmd-kit \
gcc:4.9 \
/bin/sh -c "tar vxzf libdeepmd_c.tar.gz \
&& cd examples/infer_water \
&& gcc convert_model.c -std=c99 -L ../../libdeepmd_c/lib -I ../../libdeepmd_c/include -Wl,--no-as-needed -ldeepmd_c -Wl,-rpath=../../libdeepmd_c/lib -o convert_model \
&& gcc infer_water.c -std=c99 -L ../../libdeepmd_c/lib -I ../../libdeepmd_c/include -Wl,--no-as-needed -ldeepmd_c -Wl,-rpath=../../libdeepmd_c/lib -o infer_water \
&& ./convert_model \
&& ./infer_water"

0 comments on commit b7f2ce4

Please sign in to comment.