!46154 refactor error message when gen func stub failed

Merge pull request !46154 from liubuyu/master
This commit is contained in:
i-robot 2022-11-29 11:47:29 +00:00 committed by Gitee
commit 03605e4733
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 10 additions and 3 deletions

View File

@ -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;

View File

@ -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<void *>(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.