From 9124fac08e1fe046e17a034b64a6868a3fd47495 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 15 Sep 2022 14:04:19 +0800 Subject: [PATCH] sync fork modifications --- deepmd/entrypoints/transfer.py | 1 - deepmd/utils/transfer_to_ascend.py | 12 ++++-------- source/CMakeLists.txt | 7 +++---- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/deepmd/entrypoints/transfer.py b/deepmd/entrypoints/transfer.py index 7cebaccf8d..3de91fcf5e 100644 --- a/deepmd/entrypoints/transfer.py +++ b/deepmd/entrypoints/transfer.py @@ -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: diff --git a/deepmd/utils/transfer_to_ascend.py b/deepmd/utils/transfer_to_ascend.py index 698a1da127..c2603943cb 100644 --- a/deepmd/utils/transfer_to_ascend.py +++ b/deepmd/utils/transfer_to_ascend.py @@ -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 @@ -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 diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index d46633e6ed..01888f6e28 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -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}" @@ -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)