From 40fa83f6d445103de342cb7cd1fdec1c97dbff88 Mon Sep 17 00:00:00 2001 From: CLAY-panjw <1330286576@qq.com> Date: Sat, 17 Sep 2022 11:40:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=9F=E5=BC=83=E5=BC=80=E5=85=B3=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=89=93=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tf_adapter/common/adp_logger.h | 4 ++-- tf_adapter/interface_spec/api_npu_config.pyh | 4 ++-- tf_adapter/python/npu_bridge/estimator/npu/npu_config.py | 2 +- tf_adapter/util/npu_attrs.cc | 4 ++-- tf_adapter_2.x/python/npu_device/configs/npu_config.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tf_adapter/common/adp_logger.h b/tf_adapter/common/adp_logger.h index 9282dc73c..11d9ed52b 100644 --- a/tf_adapter/common/adp_logger.h +++ b/tf_adapter/common/adp_logger.h @@ -23,13 +23,13 @@ #define LOG_DEPRECATED_WITH_REPLACEMENT(old, replacement) \ do { \ - ADP_LOG(WARNING) << "The " #old " option IS DEPRECATED. It will be removed in a future version. Please " \ + LOG(WARNING) << "The " #old " option IS DEPRECATED. It will be removed in a future version. Please " \ "use " #replacement " instead"; \ } while (false) #define LOG_DEPRECATED(old) \ do { \ - ADP_LOG(WARNING) << "The " #old " option IS DEPRECATED. It will be removed in a future version."; \ + LOG(WARNING) << "The " #old " option IS DEPRECATED. It will be removed in a future version."; \ } while (false) namespace npu { diff --git a/tf_adapter/interface_spec/api_npu_config.pyh b/tf_adapter/interface_spec/api_npu_config.pyh index b24b4e140..db3061b21 100644 --- a/tf_adapter/interface_spec/api_npu_config.pyh +++ b/tf_adapter/interface_spec/api_npu_config.pyh @@ -5,7 +5,7 @@ class NPURunConfig(run_config_lib.RunConfig): save_summary_steps=0, save_checkpoints_steps=None, save_checkpoints_secs=None, session_config=None, keep_checkpoint_max=5, keep_checkpoint_every_n_hours=10000, log_step_count_steps=100, distribute=None, enable_data_pre_proc=True, precision_mode=None, enable_reduce_precision=False, - variable_format_optimize=True, mix_compile_mode=False, hcom_parallel=False, + variable_format_optimize=True, mix_compile_mode=False, hcom_parallel=True, graph_memory_max_size=None, variable_memory_max_size=None, auto_tune_mode=None, dump_config=None, stream_max_parallel_num=None, is_tailing_optimization=False, horovod_mode=False, graph_run_mode=1, op_debug_level=0, enable_scope_fusion_passes=None, @@ -31,4 +31,4 @@ class DynamicInputConfig(): def __init__(self, input_shape, dynamic_dims, dynamic_node_type): class MemoryConfig(): - def __init__(self, atomic_clean_policy=0, static_memory_policy=None): \ No newline at end of file + def __init__(self, atomic_clean_policy=0, static_memory_policy=None): diff --git a/tf_adapter/python/npu_bridge/estimator/npu/npu_config.py b/tf_adapter/python/npu_bridge/estimator/npu/npu_config.py index 7aff4571b..bf3c61c80 100644 --- a/tf_adapter/python/npu_bridge/estimator/npu/npu_config.py +++ b/tf_adapter/python/npu_bridge/estimator/npu/npu_config.py @@ -53,7 +53,7 @@ class NPURunConfig(run_config_lib.RunConfig): enable_reduce_precision=False, variable_format_optimize=True, mix_compile_mode=False, - hcom_parallel=False, + hcom_parallel=True, graph_memory_max_size=None, variable_memory_max_size=None, auto_tune_mode=None, diff --git a/tf_adapter/util/npu_attrs.cc b/tf_adapter/util/npu_attrs.cc index 37f5aa98a..79cf3f9ff 100644 --- a/tf_adapter/util/npu_attrs.cc +++ b/tf_adapter/util/npu_attrs.cc @@ -361,7 +361,7 @@ void NpuAttrs::SetDatasetExecuteInDeviceStatus(const std::string &iterator_name, std::map NpuAttrs::GetSessOptions(const OpKernelConstruction *ctx) { std::map sess_options; std::string variable_format_optimize = "1"; - std::string hcom_parallel = "0"; + std::string hcom_parallel = "1"; std::string graph_memory_max_size; std::string variable_memory_max_size; std::string enable_dump = "0"; @@ -1395,7 +1395,7 @@ std::map NpuAttrs::GetDefaultPassOptions() { Status NpuAttrs::SetNpuOptimizerAttr(const GraphOptimizationPassOptions &options, Node *node) { std::map sess_options; bool variable_format_optimize = true; - bool hcom_parallel = false; + bool hcom_parallel = true; std::string graph_memory_max_size; std::string variable_memory_max_size; bool enable_dump = false; diff --git a/tf_adapter_2.x/python/npu_device/configs/npu_config.py b/tf_adapter_2.x/python/npu_device/configs/npu_config.py index 109ad5225..354c4ab50 100644 --- a/tf_adapter_2.x/python/npu_device/configs/npu_config.py +++ b/tf_adapter_2.x/python/npu_device/configs/npu_config.py @@ -42,7 +42,7 @@ class NpuConfig(NpuBaseConfig): self.op_compiler_cache_mode = OptionValue('disable', ['enable', 'disable', 'force']) self.op_compiler_cache_dir = OptionValue(None, None) self.stream_max_parallel_num = OptionValue(None, None) - self.hcom_parallel = OptionValue(False, [True, False]) + self.hcom_parallel = OptionValue(True, [True, False]) self.hcom_multi_mode = OptionValue(None, None) self.is_tailing_optimization = OptionValue(False, [True, False]) self.op_debug_level = OptionValue(0, [0, 1, 2, 3, 4]) -- Gitee