From 75c7a17bff0de9e09071f3bc06323e6b435d805a Mon Sep 17 00:00:00 2001 From: lby Date: Mon, 28 Nov 2022 20:14:19 +0800 Subject: [PATCH] refactor error message when gen func stub failed --- mindspore/ccsrc/kernel/kash/kernel_pack.cc | 2 +- .../plugin/device/ascend/kernel/tbe/tbe_utils.cc | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/mindspore/ccsrc/kernel/kash/kernel_pack.cc b/mindspore/ccsrc/kernel/kash/kernel_pack.cc index 2262e0b33d7..bd757b85033 100644 --- a/mindspore/ccsrc/kernel/kash/kernel_pack.cc +++ b/mindspore/ccsrc/kernel/kash/kernel_pack.cc @@ -33,7 +33,7 @@ bool CheckHash(const std::string &json_file, const std::string &bin_file, const std::string sha256_cal = system::sha256::GetHashFromFile(bin_file); std::string sha256_str = js["sha256"]; if (sha256_cal.empty() || sha256_cal != sha256_str) { - MS_LOG(ERROR) << "Cal sha256 of " << bin_file << " failed."; + MS_LOG(WARNING) << "Check sha256 for [" << bin_file << "] failed, it will try to rebuild the op."; return false; } return true; 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 213539282c0..26f3b46eb70 100644 --- a/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_utils.cc +++ b/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_utils.cc @@ -275,7 +275,11 @@ int KernelManager::BinaryRegister(const mindspore::kernel::FlexArray &kernel_buf dev_bin.version = 0; auto ret = has_kernel_list ? rtRegisterAllKernel(&dev_bin, module) : rtDevBinaryRegister(&dev_bin, module); if (RT_ERROR_NONE != ret) { - MS_LOG(INFO) << "Call runtime rtDevBinaryRegister error."; + MS_LOG(INFO) << "Call runtime rtDevBinaryRegister error, ret: [" << ret + << "], error message: " << device::ascend::GetErrorMessage(true) + << ". Try to delete kernel compile cache files, and restart you project again.(These cache files in " + "the custom directory if you used the environment variable 'MS_COMPILER_CACHE_PATH', otherwise in " + "the current directory)."; return -1; } return 0; @@ -329,7 +333,10 @@ uintptr_t KernelManager::GenFuncStub(const mindspore::kernel::KernelPack &kernel uintptr_t func_stub = ++kernel_stub_gen_; if (RT_ERROR_NONE != rtFunctionRegister(module, reinterpret_cast(func_stub), func_name.c_str(), func_name.c_str(), 0)) { - MS_LOG(INFO) << "Call runtime rtFunctionRegister error."; + MS_LOG(INFO) << "Call runtime rtFunctionRegister error, message:" << device::ascend::GetErrorMessage(true) + << ". Try to delete kernel compile cache files, and restart you project again.(These cache files in " + "the custom directory if you used the environment variable 'MS_COMPILER_CACHE_PATH', otherwise in " + "the current directory)."; return 0; } // cache the registered kernelmeta.