diff --git a/tf_adapter/util/ge_plugin.cc b/tf_adapter/util/ge_plugin.cc index 86532ef359f59b358da66dd5c56a6bcf457e4579..a74aafa6394cfc84f4584baae8c08b160c676ccd 100644 --- a/tf_adapter/util/ge_plugin.cc +++ b/tf_adapter/util/ge_plugin.cc @@ -171,6 +171,8 @@ void GePlugin::Init(std::map &init_options, const bool // debug configuration ADP_LOG(INFO) << "[GePlugin] op_debug_level : " << init_options[ge::OP_DEBUG_LEVEL]; + ADP_LOG(INFO) << "[GePlugin] ge.deterministic :" << init_options["ge.deterministic"]; + // scope fusion configuration ADP_LOG(INFO) << "[GePlugin] enable_scope_fusion_passes : " << init_options[ge::OPTION_EXEC_ENABLE_SCOPE_FUSION_PASSES]; diff --git a/tf_adapter/util/npu_attrs.cc b/tf_adapter/util/npu_attrs.cc index 96931554013a5f1c38d263d0e4c8638633e8ca15..4e668d690d67d12431c949a66b697068e42ad7bd 100644 --- a/tf_adapter/util/npu_attrs.cc +++ b/tf_adapter/util/npu_attrs.cc @@ -446,7 +446,8 @@ std::map NpuAttrs::GetSessOptions(const OpKernelConstr (void) ctx->GetAttr("_dynamic_dims", &dynamic_dims); (void) ctx->GetAttr("_buffer_optimize", &buffer_optimize); (void) ctx->GetAttr("_enable_small_channel", &enable_small_channel); - (void) ctx->GetAttr("_deterministic", &deterministic); + (void) ctx->GetAttr("_enable_deterministic", &deterministic); + ADP_LOG(INFO) << "has deterministic = " << ctx->HasAttr("_deterministic"); (void) ctx->GetAttr("_fusion_switch_file", &fusion_switch_file); (void) ctx->GetAttr("_enable_compress_weight", &enable_compress_weight); (void) ctx->GetAttr("_compress_weight_conf", &compress_weight_conf); @@ -550,6 +551,7 @@ std::map NpuAttrs::GetInitOptions(const OpKernelConstr std::string auto_tune_mode; std::string graph_run_mode = "1"; std::string op_debug_level = "0"; + std::string deterministic = "0"; std::string enable_scope_fusion_passes; std::string enable_exception_dump; std::string op_compiler_cache_mode; @@ -589,6 +591,8 @@ std::map NpuAttrs::GetInitOptions(const OpKernelConstr (void) ctx->GetAttr("_auto_tune_mode", &auto_tune_mode); (void) ctx->GetAttr("_graph_run_mode", &graph_run_mode); (void) ctx->GetAttr("_op_debug_level", &op_debug_level); + (void) ctx->GetAttr("__enable_deterministic", &deterministic); + ADP_LOG(INFO) << "has deterministic = " << ctx->HasAttr("_deterministic"); (void) ctx->GetAttr("_enable_scope_fusion_passes", &enable_scope_fusion_passes); (void) ctx->GetAttr("_enable_exception_dump", &enable_exception_dump); (void) ctx->GetAttr("_aoe_mode", &aoe_mode); @@ -632,6 +636,7 @@ std::map NpuAttrs::GetInitOptions(const OpKernelConstr init_options_["ge.autoTuneMode"] = auto_tune_mode; init_options_[ge::OPTION_GRAPH_RUN_MODE] = graph_run_mode; init_options_[ge::OP_DEBUG_LEVEL] = op_debug_level; + init_options_["ge.deterministic"] = deterministic; init_options_[ge::OPTION_EXEC_ENABLE_SCOPE_FUSION_PASSES] = enable_scope_fusion_passes; init_options_["ge.exec.enable_exception_dump"] = enable_exception_dump; init_options_["ge.jobType"] = aoe_mode; @@ -1099,7 +1104,7 @@ std::map NpuAttrs::GetAllAttrOptions(const AttrSlice & auto distribute_config_value = attrs.Find("_distribute_config"); auto buffer_optimize_value = attrs.Find("_buffer_optimize"); auto enable_small_channel_value = attrs.Find("_enable_small_channel"); - auto deterministic_value = attrs.Find("_deterministic"); + auto deterministic_value = attrs.Find("_enable_deterministic"); auto fusion_switch_file_value = attrs.Find("_fusion_switch_file"); auto enable_compress_weight_value = attrs.Find("_enable_compress_weight"); auto compress_weight_conf_value = attrs.Find("_compress_weight_conf"); @@ -1470,7 +1475,7 @@ std::map NpuAttrs::GetAllAttrOptions(const AttrSlice & all_options["distribute_config"] = distribute_config; all_options["buffer_optimize"] = buffer_optimize; all_options["enable_small_channel"] = enable_small_channel; - all_options["deterministic"] = deterministic; + all_options["ge.deterministic"] = deterministic; all_options["fusion_switch_file"] = fusion_switch_file; all_options["enable_compress_weight"] = enable_compress_weight; all_options["compress_weight_conf"] = compress_weight_conf; @@ -1898,6 +1903,9 @@ Status NpuAttrs::SetNpuOptimizerAttr(const GraphOptimizationPassOptions &options } if (params.count("deterministic") > 0) { deterministic = params.at("deterministic").i(); + ADP_LOG(INFO) << "set deterministic = " << deterministic; + } else { + ADP_LOG(INFO) << "deterministic count 0."; } if (params.count("fusion_switch_file") > 0) { fusion_switch_file = params.at("fusion_switch_file").s(); @@ -2067,7 +2075,6 @@ Status NpuAttrs::SetNpuOptimizerAttr(const GraphOptimizationPassOptions &options sess_options["dynamic_node_type"] = std::to_string(dynamic_node_type); sess_options["buffer_optimize"] = buffer_optimize; sess_options["enable_small_channel"] = std::to_string(enable_small_channel); - sess_options["deterministic"] = std::to_string(deterministic); sess_options["fusion_switch_file"] = fusion_switch_file; sess_options["enable_compress_weight"] = std::to_string(static_cast(enable_compress_weight)); sess_options["compress_weight_conf"] = compress_weight_conf; @@ -2103,6 +2110,7 @@ Status NpuAttrs::SetNpuOptimizerAttr(const GraphOptimizationPassOptions &options init_options_["graph_run_mode"] = std::to_string(graph_run_mode); init_options_[ge::OPTION_GRAPH_RUN_MODE] = std::to_string(graph_run_mode); init_options_["op_debug_level"] = std::to_string(op_debug_level); + init_options_["enable_deterministic"] = std::to_string(deterministic); init_options_[ge::OP_DEBUG_LEVEL] = std::to_string(op_debug_level); init_options_["enable_scope_fusion_passes"] = enable_scope_fusion_passes; init_options_[ge::OPTION_EXEC_ENABLE_SCOPE_FUSION_PASSES] = enable_scope_fusion_passes; diff --git a/tf_adapter/util/session_manager.cc b/tf_adapter/util/session_manager.cc index 17fe6d6e0ef7588d9dcd0143b011ded4257951f2..0763c33efeb689de10ea9987e6ee052f07634f2f 100644 --- a/tf_adapter/util/session_manager.cc +++ b/tf_adapter/util/session_manager.cc @@ -147,7 +147,7 @@ void SessionManager::PrintGeSessionOptions(std::map &s ADP_LOG(INFO) << "[GEOP] enable_small_channel :" << sess_options["ge.enableSmallChannel"]; - ADP_LOG(INFO) << "[GEOP] deterministic :" << sess_options["ge.deterministic"]; + ADP_LOG(INFO) << "[GEOP] ge.deterministic :" << sess_options["ge.deterministic"]; ADP_LOG(INFO) << "[GEOP] fusion_switch_file :" << sess_options["ge.fusionSwitchFile"];