!23528 Set default work stream id of ErrorManager

Merge pull request !23528 from tanghuikang/error_manager_workstreamid
This commit is contained in:
i-robot 2021-09-16 01:12:28 +00:00 committed by Gitee
commit e00b51ce35
4 changed files with 7 additions and 0 deletions

View File

@ -1905,6 +1905,8 @@ void AscendSession::ReportErrorMessage() {
}
}
void AscendSession::SetThreadContext() { ErrorManager::GetInstance().GenWorkStreamIdDefault(); }
void AscendSession::ExecuteAllTaskInQueue() {
// Execute All Task
auto &task_manager = PynativeTaskManager::GetInstance();

View File

@ -78,6 +78,7 @@ class AscendSession : public SessionBasic {
std::string GetCommWorldGroup() override { return kHcclWorldGroup; }
void ReportWarningMessage() override;
void ReportErrorMessage() override;
void SetThreadContext() override;
void ExecuteAllTaskInQueue() override;
void UpdateOutputTensors(const VectorRef *outputs,
const std::map<tensor::TensorPtr, session::KernelWithIndex> &tensor_to_node,

View File

@ -214,6 +214,9 @@ void Executor::WorkerLoop() {
return;
}
try {
if (task->session_ != nullptr) {
task->session_->SetThreadContext();
}
task->Run();
if (task->session_ != nullptr) {
task->session_->ReportWarningMessage();

View File

@ -155,6 +155,7 @@ class SessionBasic : public std::enable_shared_from_this<SessionBasic> {
static void RunOpHideNopNode(const KernelGraphPtr &kernel_graph);
virtual void ReportWarningMessage() {}
virtual void ReportErrorMessage() {}
virtual void SetThreadContext() {}
#ifdef ENABLE_DEBUGGER
// set debugger
void SetDebugger() {