Skip to content

Commit

Permalink
sync fork modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Sep 15, 2022
1 parent 98a68c9 commit 9124fac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
1 change: 0 additions & 1 deletion deepmd/entrypoints/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ def modify_const_op(new_graph_def: tf.Graph) -> tf.Graph:
-------
tf.Graph
natoms transfer to a const op for Ascend platform
-------
"""
for node in new_graph_def.node:
if "t_natoms" in node.name:
Expand Down
12 changes: 4 additions & 8 deletions deepmd/utils/transfer_to_ascend.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,8 @@ def mix_precision(
)
except GraphTooLargeError as e:
raise RuntimeError(
"The uniform step size of the tabulation's first table is %f, "
"which is too small. This leads to a very large graph size, "
"exceeding protobuf's limitation (2 GB). You should try to "
"increase the step size." % step
"The ascend transfered mix-precision model size is too large, "
"exceeding protobuf's limitation (2 GB)."
) from e

# reset the graph, otherwise the size limitation will be only 2 GB / 2 = 1 GB
Expand All @@ -121,10 +119,8 @@ def mix_precision(
freeze(checkpoint_folder=checkpoint_folder, output=output, node_names=None)
except GraphTooLargeError as e:
raise RuntimeError(
"The uniform step size of the tabulation's first table is %f, "
"which is too small. This leads to a very large graph size, "
"exceeding protobuf's limitation (2 GB). You should try to "
"increase the step size." % step
"The ascend transfered mix-precision model size is too large, "
"exceeding protobuf's limitation (2 GB)."
) from e

# stage 3: transfer the mix-precision model
Expand Down
7 changes: 3 additions & 4 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ if (USE_ASCEND)
set(DP_VARIANT "ascend")
endif(USE_ASCEND)
if (USE_ASCEND AND BUILD_CPP_IF)
set(PYTHON_EXECUTABLE "python3.7")
if (NOT DEFINED ${PYTHON_EXECUTABLE})
set(PYTHON_EXECUTABLE "python3.7")
endif()
set(FIND_TENSORFLOW_INC "import tensorflow as tf; print(tf.sysconfig.get_compile_flags()[0],end='')")
execute_process(
COMMAND ${PYTHON_EXECUTABLE} "-c" "${FIND_TENSORFLOW_INC}"
Expand Down Expand Up @@ -126,9 +128,6 @@ if (USE_TF_PYTHON_LIBS)
find_package (Python COMPONENTS Interpreter Development REQUIRED)
endif(USE_TF_PYTHON_LIBS)

# find tensorflow, I need tf abi info
find_package(tensorflow REQUIRED)

if (TENSORFLOW_VERSION VERSION_GREATER_EQUAL 2.10)
set (CMAKE_CXX_STANDARD 17)
elseif (TENSORFLOW_VERSION VERSION_GREATER_EQUAL 2.7)
Expand Down

0 comments on commit 9124fac

Please sign in to comment.