From b772064ce751d51303770249876307742dbcf02c Mon Sep 17 00:00:00 2001 From: huanruizhi Date: Mon, 23 Sep 2024 11:18:17 +0800 Subject: [PATCH] remove mdat config --- tf_adapter/kernels/aicore/fast_gelu_v2_ops.cc | 2 +- tf_adapter/kernels/geop_npu.cc | 4 +--- tf_adapter/python/npu_bridge/estimator/npu/util.py | 6 +++--- tf_adapter/util/npu_attrs.cc | 4 ++-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/tf_adapter/kernels/aicore/fast_gelu_v2_ops.cc b/tf_adapter/kernels/aicore/fast_gelu_v2_ops.cc index 5d92e710d..0078cd669 100644 --- a/tf_adapter/kernels/aicore/fast_gelu_v2_ops.cc +++ b/tf_adapter/kernels/aicore/fast_gelu_v2_ops.cc @@ -23,7 +23,7 @@ class FastGeluV2Op : public OpKernel { explicit FastGeluV2Op(OpKernelConstruction *context) : OpKernel(context) { LOG(INFO) << "new FastGeluV2Op"; } - ~FastGeluV2Op() = default; + ~FastGeluV2Op() override = default; void Compute(OpKernelContext *context) override { (void) context; LOG(INFO) << "FastGeluV2Op Compute"; diff --git a/tf_adapter/kernels/geop_npu.cc b/tf_adapter/kernels/geop_npu.cc index 58726faf5..883d07bd3 100644 --- a/tf_adapter/kernels/geop_npu.cc +++ b/tf_adapter/kernels/geop_npu.cc @@ -91,7 +91,6 @@ Status FunctionalizeControlFlow(Graph *graph, FunctionLibraryDefinition *library #endif namespace { const std::string ATTR_NAME_CONST_INPUT_NAME = "_const_input"; -const std::string kMdatTuning = "mdat"; const std::string kAutoRecompute = "auto"; const std::string kTotalStep = "TOTAL_STEP"; const std::string kStepNow = "STEP_NOW"; @@ -2091,9 +2090,8 @@ int GeOp::RunTuning(std::vector &input_vec, std::vector &inp graph_options_["ge.graphLevelSat"] = (mix_compile_mode_ == "0") ? "1" : "0"; // run aoe tuning - bool is_mdat_tuning = (init_options_["ge.jobType"] == kMdatTuning) && (recompute_mode_ == kAutoRecompute); if ((init_options_["ge.jobType"] == "1") || (init_options_["ge.jobType"] == "2") || - ((init_options_["ge.jobType"] == "4") && is_allreduce) || is_mdat_tuning) { + ((init_options_["ge.jobType"] == "4") && is_allreduce)) { std::function callback = [this]() { if (aoe_destroy_session_ != nullptr) { AoeStatus aoe_destroy_ret = (*aoe_destroy_session_)(session_id_); diff --git a/tf_adapter/python/npu_bridge/estimator/npu/util.py b/tf_adapter/python/npu_bridge/estimator/npu/util.py index b59752d7c..30aadca79 100644 --- a/tf_adapter/python/npu_bridge/estimator/npu/util.py +++ b/tf_adapter/python/npu_bridge/estimator/npu/util.py @@ -154,11 +154,11 @@ def check_aoe_mode(aoe_mode): Return: aoe_mode Raise: - If aoe_mode is null or not in ['1', '2', '4', 'mdat']. + If aoe_mode is null or not in ['1', '2', '4']. """ - aoe_modes = ['1', '2', '4', 'mdat'] + aoe_modes = ['1', '2', '4'] if aoe_mode not in aoe_modes: - raise ValueError("aoe_mode:%s is invalid, should be in ['1', '2', '4', 'mdat']" % (aoe_mode)) + raise ValueError("aoe_mode:%s is invalid, should be in ['1', '2', '4']" % (aoe_mode)) def register_func(var_name): diff --git a/tf_adapter/util/npu_attrs.cc b/tf_adapter/util/npu_attrs.cc index 4044dda8d..1d619cd59 100644 --- a/tf_adapter/util/npu_attrs.cc +++ b/tf_adapter/util/npu_attrs.cc @@ -330,13 +330,13 @@ Status CheckVariablePlacement(const std::string &variable_placement) { } inline Status CheckAoeMode(const std::string &aoe_mode) { - std::set aoe_mode_list = {"1", "2", "4", "mdat"}; + std::set aoe_mode_list = {"1", "2", "4"}; if (aoe_mode_list.find(aoe_mode) != aoe_mode_list.end()) { return Status::OK(); } else { return errors::InvalidArgument("aoe mode:", aoe_mode.c_str(), - " is invalid, aoe mode should be one of the list:['1', '2', '4', 'mdat']"); + " is invalid, aoe mode should be one of the list:['1', '2', '4']"); } } -- Gitee