|
|
@ -28,6 +28,7 @@
|
|
|
|
#include "backend/kernel_compiler/tbe/tbe_convert_utils.h"
|
|
|
|
#include "backend/kernel_compiler/tbe/tbe_convert_utils.h"
|
|
|
|
#include "backend/kernel_compiler/tbe/tbe_utils.h"
|
|
|
|
#include "backend/kernel_compiler/tbe/tbe_utils.h"
|
|
|
|
#include "backend/kernel_compiler/tbe/tbe_dynaminc_shape_util.h"
|
|
|
|
#include "backend/kernel_compiler/tbe/tbe_dynaminc_shape_util.h"
|
|
|
|
|
|
|
|
#include "utils/trace_base.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace mindspore {
|
|
|
|
namespace mindspore {
|
|
|
|
namespace kernel {
|
|
|
|
namespace kernel {
|
|
|
@ -77,11 +78,13 @@ bool TbeOpParallelBuild(const std::vector<AnfNodePtr> &anf_nodes) {
|
|
|
|
std::string build_result;
|
|
|
|
std::string build_result;
|
|
|
|
auto ret = build_manger->WaitOne(&task_id, &task_result, &build_result);
|
|
|
|
auto ret = build_manger->WaitOne(&task_id, &task_result, &build_result);
|
|
|
|
if (!ret) {
|
|
|
|
if (!ret) {
|
|
|
|
MS_EXCEPTION(ArgumentError) << "Build Failed. wait one ret:" << ret << ", task id:" << task_id;
|
|
|
|
MS_EXCEPTION(ArgumentError) << "Build Failed. wait one ret:" << ret << ", task id:" << task_id
|
|
|
|
|
|
|
|
<< " trace: " << trace::DumpSourceLines(build_manger->GetAnfNodeByTaskID(task_id));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (task_result != "Success") {
|
|
|
|
if (task_result != "Success") {
|
|
|
|
MS_EXCEPTION(ArgumentError) << "task compile Failed, task id:" << task_id << ", cause:" << task_result;
|
|
|
|
MS_EXCEPTION(ArgumentError) << "task compile Failed, task id:" << task_id << ", cause:" << task_result
|
|
|
|
|
|
|
|
<< " trace: " << trace::DumpSourceLines(build_manger->GetAnfNodeByTaskID(task_id));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
(void)build_manger->TaskFinishProcess(task_id, build_result);
|
|
|
|
(void)build_manger->TaskFinishProcess(task_id, build_result);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -248,6 +251,14 @@ void ParallelBuildManager::ResetTaskInfo() {
|
|
|
|
AscendKernelBuildClient::Instance().TbeReset();
|
|
|
|
AscendKernelBuildClient::Instance().TbeReset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AnfNodePtr ParallelBuildManager::GetAnfNodeByTaskID(int32_t task_id) {
|
|
|
|
|
|
|
|
auto find_iter = task_map_.find(task_id);
|
|
|
|
|
|
|
|
if (find_iter != task_map_.end()) {
|
|
|
|
|
|
|
|
return find_iter->second.node;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::string ParallelBuildManager::ProcessBuildRetStr(const std::string &build_result) {
|
|
|
|
std::string ParallelBuildManager::ProcessBuildRetStr(const std::string &build_result) {
|
|
|
|
std::string start_flag = "fusion_pattern_start";
|
|
|
|
std::string start_flag = "fusion_pattern_start";
|
|
|
|
std::string end_flag = "fusion_pattern_end";
|
|
|
|
std::string end_flag = "fusion_pattern_end";
|
|
|
|