Browse Source

!9194 add node trace when build operator failed

From: @jjfeing
Reviewed-by: @kisnwang,@zh_qh
Signed-off-by: @zh_qh
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
0694c2d31c
2 changed files with 14 additions and 2 deletions
  1. +13
    -2
      mindspore/ccsrc/backend/kernel_compiler/tbe/tbe_kernel_parallel_build.cc
  2. +1
    -0
      mindspore/ccsrc/backend/kernel_compiler/tbe/tbe_kernel_parallel_build.h

+ 13
- 2
mindspore/ccsrc/backend/kernel_compiler/tbe/tbe_kernel_parallel_build.cc View File

@@ -28,6 +28,7 @@
#include "backend/kernel_compiler/tbe/tbe_convert_utils.h"
#include "backend/kernel_compiler/tbe/tbe_utils.h"
#include "backend/kernel_compiler/tbe/tbe_dynaminc_shape_util.h"
#include "utils/trace_base.h"

namespace mindspore {
namespace kernel {
@@ -77,11 +78,13 @@ bool TbeOpParallelBuild(const std::vector<AnfNodePtr> &anf_nodes) {
std::string build_result;
auto ret = build_manger->WaitOne(&task_id, &task_result, &build_result);
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") {
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);
}
@@ -248,6 +251,14 @@ void ParallelBuildManager::ResetTaskInfo() {
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 start_flag = "fusion_pattern_start";
std::string end_flag = "fusion_pattern_end";


+ 1
- 0
mindspore/ccsrc/backend/kernel_compiler/tbe/tbe_kernel_parallel_build.h View File

@@ -64,6 +64,7 @@ class ParallelBuildManager {
static int StartCompileOp(const nlohmann::json &kernel_json);
static bool WaitOne(int *task_id, std::string *task_result, std::string *build_result);
void ResetTaskInfo();
AnfNodePtr GetAnfNodeByTaskID(int32_t task_id);

private:
std::string ProcessBuildRetStr(const std::string &build_result);


Loading…
Cancel
Save