From 96692dbbe68531fc2af62f24d1bec18d69c54461 Mon Sep 17 00:00:00 2001 From: CLAY-panjw <1330286576@qq.com> Date: Tue, 6 Sep 2022 12:27:26 +0800 Subject: [PATCH] =?UTF-8?q?tf=E5=BA=9F=E5=BC=83=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tf_adapter/python/npu_bridge/estimator/npu/npu_config.py | 2 +- tf_adapter/util/npu_attrs.cc | 8 +++++++- tf_adapter_2.x/python/npu_device/configs/npu_config.py | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) 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 8001f13ee..3548d2774 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 ed327226a..a4c8ef04f 100644 --- a/tf_adapter/util/npu_attrs.cc +++ b/tf_adapter/util/npu_attrs.cc @@ -850,6 +850,7 @@ std::map NpuAttrs::GetPassOptions(const AttrSlice &att if (NpuOptimizer_value != nullptr) { do_npu_optimizer = "1"; if (enable_data_pre_proc_value != nullptr) { + ADP_LOG(WARNING) << "The enable_data_pre_proc option IS DEPRECATED. It will be removed in a future version"; enable_dp = enable_data_pre_proc_value->s(); } if (use_off_line_value != nullptr) { @@ -1060,6 +1061,7 @@ std::map NpuAttrs::GetAllAttrOptions(const AttrSlice & if (NpuOptimizer_value != nullptr) { do_npu_optimizer = "1"; if (enable_data_pre_proc_value != nullptr) { + ADP_LOG(WARNING) << "The enable_data_pre_proc option IS DEPRECATED. It will be removed in a future version"; enable_dp = enable_data_pre_proc_value->s(); } if (use_off_line_value != nullptr) { @@ -1189,9 +1191,13 @@ std::map NpuAttrs::GetAllAttrOptions(const AttrSlice & enable_exception_dump = enable_exception_dump_value->s(); } if (op_select_implmode_value != nullptr) { + ADP_LOG(WARNING) << "The op_select_implmode option IS DEPRECATED. It will be removed in a future version. Please " + "use op_precision_mode instead"; op_select_implmode = op_select_implmode_value->s(); } if (optypelist_for_implmode_value != nullptr) { + ADP_LOG(WARNING) << "The optypelist_for_implmode option IS DEPRECATED. It will be removed in a future version. Please " + "use op_precision_mode instead"; optypelist_for_implmode = optypelist_for_implmode_value->s(); } if (input_shape_value != nullptr) { @@ -1385,7 +1391,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 09d157227..a7a6c67b8 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