From fc884132952ab411014e9d2ba15cbc0beff32f81 Mon Sep 17 00:00:00 2001 From: ZPaC Date: Wed, 14 Sep 2022 17:48:35 +0800 Subject: [PATCH] upgrade Ascend package 14 Sept on master --- .jenkins/check/config/filter_cppcheck.txt | 1 + graphengine | 2 +- mindspore/ccsrc/common/debug/common.cc | 12 ++++++++++++ mindspore/ccsrc/include/common/debug/common.h | 1 + .../plugin/device/ascend/kernel/tbe/tbe_utils.cc | 10 ++++++++++ .../plugin/device/ascend/kernel/tbe/tbe_utils.h | 2 ++ mindspore/ccsrc/ps/OWNERS | 2 ++ .../parallel_compile/tbe_compiler/tbe_helper.py | 2 ++ tests/ut/cpp/stub/transform/util.cc | 8 ++++++++ 9 files changed, 39 insertions(+), 1 deletion(-) diff --git a/.jenkins/check/config/filter_cppcheck.txt b/.jenkins/check/config/filter_cppcheck.txt index 7643d7aec29..6096ff17cc0 100644 --- a/.jenkins/check/config/filter_cppcheck.txt +++ b/.jenkins/check/config/filter_cppcheck.txt @@ -66,3 +66,4 @@ "mindspore/mindspore/lite/src/litert/kernel/cpu/fp32/convolution_im2col_fp32.cc" "shadowVariable" "mindspore/mindspore/lite/src/litert/kernel/cpu/fp32/convolution_winograd_fp32.cc" "knownConditionTrueFalse" "mindspore/mindspore/lite/src/litert/kernel/cpu/fp32/convolution_winograd_fp32.cc" "shadowVariable" +"mindspore/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_utils.cc" "knownConditionTrueFalse" diff --git a/graphengine b/graphengine index 8eb49d2da35..b56450bde6d 160000 --- a/graphengine +++ b/graphengine @@ -1 +1 @@ -Subproject commit 8eb49d2da35ff40e6423f576bd7b7f60685e02da +Subproject commit b56450bde6d5afa1c557437ebf154487afe355f0 diff --git a/mindspore/ccsrc/common/debug/common.cc b/mindspore/ccsrc/common/debug/common.cc index c6e249da2ed..ec661053eb8 100644 --- a/mindspore/ccsrc/common/debug/common.cc +++ b/mindspore/ccsrc/common/debug/common.cc @@ -361,6 +361,18 @@ std::string Common::GetCompilerCachePath() { return compile_cache_dir; } +std::string Common::GetKernelMetaTempDir() { + auto cache_path = GetUserDefineCachePath(); + std::string rank_id_str = common::GetEnv(kRankID); + if (rank_id_str.empty()) { + MS_LOG(DEBUG) << "Environment variable 'RANK_ID' is empty, using the default value: 0"; + rank_id_str = "0"; + } + auto kernel_meta_temp_dir = cache_path + +"rank_" + rank_id_str + "/kernel_meta_temp_dir/"; + (void)FileUtils::CreateNotExistDirs(kernel_meta_temp_dir); + return kernel_meta_temp_dir; +} + bool Common::GetDebugTerminate() { return debugger_terminate_; } bool Common::GetDebugExitSuccess() { return exit_success_; } diff --git a/mindspore/ccsrc/include/common/debug/common.h b/mindspore/ccsrc/include/common/debug/common.h index dea5d850992..72000645e45 100644 --- a/mindspore/ccsrc/include/common/debug/common.h +++ b/mindspore/ccsrc/include/common/debug/common.h @@ -52,6 +52,7 @@ class COMMON_EXPORT Common { static bool CommonFuncForConfigPath(const std::string &default_path, const std::string &env_path, std::string *const value); static std::string GetCompilerCachePath(); + static std::string GetKernelMetaTempDir(); static std::string GetUserDefineCachePath(); static bool GetDebugTerminate(); static bool GetDebugExitSuccess(); diff --git a/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_utils.cc b/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_utils.cc index dae6ca5aa93..3b9d800c9ba 100644 --- a/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_utils.cc +++ b/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_utils.cc @@ -113,6 +113,15 @@ std::string TbeUtils::GetOpDebugPath() { return debug_path; } +std::string TbeUtils::GetKernelMetaTempDir() { + static std::string debug_path; + if (!debug_path.empty()) { + return debug_path; + } + debug_path = Common::GetKernelMetaTempDir(); + return debug_path; +} + std::string GetOpDebugLevel() { static const std::set value_ranges = {OP_DEBUG_LEVEL_0, OP_DEBUG_LEVEL_1, OP_DEBUG_LEVEL_2, OP_DEBUG_LEVEL_3, OP_DEBUG_LEVEL_4}; @@ -151,6 +160,7 @@ nlohmann::json TbeUtils::GenSocInfo() { soc_info_json["socVersion"] = device::ascend::GetSocVersion(); soc_info_json["offlineTune"] = CheckOfflineTune(); soc_info_json["op_debug_dir"] = GetOpDebugPath(); + soc_info_json["kernel_meta_temp_dir"] = GetKernelMetaTempDir(); soc_info_json["op_debug_level"] = GetOpDebugLevel(); soc_info_json["autoTilingMode"] = context_ptr->get_param(MS_CTX_TUNE_MODE); soc_info_json["deviceId"] = std::to_string(context_ptr->get_param(MS_CTX_DEVICE_ID)); diff --git a/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_utils.h b/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_utils.h index ece6e615809..12ad278edf2 100644 --- a/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_utils.h +++ b/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_utils.h @@ -58,6 +58,8 @@ class TbeUtils { static std::string GetOpDebugPath(); + static std::string GetKernelMetaTempDir(); + static std::string GetBankPath(); static std::string GetTuneDumpPath(); diff --git a/mindspore/ccsrc/ps/OWNERS b/mindspore/ccsrc/ps/OWNERS index 640dcabe469..2fc6af5ad99 100644 --- a/mindspore/ccsrc/ps/OWNERS +++ b/mindspore/ccsrc/ps/OWNERS @@ -4,6 +4,8 @@ approvers: - jxlang910 - zhangzhaoju - xu-yfei +- cristoval +- limingqi107 reviewers: - tan-wei-cheng-3260 - wtcheng diff --git a/mindspore/python/mindspore/_extends/parallel_compile/tbe_compiler/tbe_helper.py b/mindspore/python/mindspore/_extends/parallel_compile/tbe_compiler/tbe_helper.py index 32ba8e5ba4b..4ddec41d644 100644 --- a/mindspore/python/mindspore/_extends/parallel_compile/tbe_compiler/tbe_helper.py +++ b/mindspore/python/mindspore/_extends/parallel_compile/tbe_compiler/tbe_helper.py @@ -148,6 +148,7 @@ def get_soc_info(initialize_job_info): soc_param["vector_fp_ceiling"] = initialize_job_info["SocInfo"]["vector_fp_ceiling"] soc_param['mdl_bank_path'] = initialize_job_info["SocInfo"]["mdl_bank_path"] soc_param['op_bank_path'] = initialize_job_info["SocInfo"]["op_bank_path"] + soc_param['kernel_meta_temp_dir'] = initialize_job_info["SocInfo"]["kernel_meta_temp_dir"] soc_info = list() soc_info.append(initialize_job_info["SocInfo"]["socVersion"]) @@ -291,6 +292,7 @@ def get_options_info(job_content): options["deviceId"] = job_content["SocInfo"]["deviceId"] options["autoTilingMode"] = job_content["SocInfo"]["autoTilingMode"] options["op_impl_mode_list"] = job_content["SocInfo"]["op_impl_mode_list"] + options["kernel_meta_temp_dir"] = job_content["SocInfo"]["kernel_meta_temp_dir"] options["status_check"] = "false" return options diff --git a/tests/ut/cpp/stub/transform/util.cc b/tests/ut/cpp/stub/transform/util.cc index 4e9a4f75bcf..15ed704132e 100644 --- a/tests/ut/cpp/stub/transform/util.cc +++ b/tests/ut/cpp/stub/transform/util.cc @@ -29,6 +29,14 @@ #include "transform/graph_ir/op_adapter_util.h" #include "graph/operator.h" +namespace ge { +void Operator::InputRegister(char const *, char const *) {} +void Operator::OutputRegister(char const *, char const *) {} +void Operator::OptionalInputRegister(char const *, char const *) {} +void Operator::DynamicInputRegister(char const *, unsigned int, char const *, bool) {} +void Operator::DynamicOutputRegister(char const *, unsigned int, char const *, bool) {} +} // namespace ge + namespace mindspore { namespace transform { namespace {