forked from mindspore-Ecosystem/mindspore
!27446 Use super kernel actor to load data for dump (Ascend)
Merge pull request !27446 from parastooashtari/super_kernel
This commit is contained in:
commit
5087d2e985
|
@ -483,15 +483,6 @@ void Debugger::PostExecuteGraphDebugger() {
|
|||
DumpJsonParser::GetInstance().UpdateDumpIter();
|
||||
return;
|
||||
}
|
||||
for (const auto &graph_ptr : debugger_->GetGraphPtrList()) {
|
||||
if (device_target_ == kAscendDevice) {
|
||||
debugger_->SetGraphPtr(graph_ptr);
|
||||
// load output for Ascend
|
||||
debugger_->LoadGraphOutputs();
|
||||
// load parameters for Ascend
|
||||
debugger_->LoadParametersAndConst();
|
||||
}
|
||||
}
|
||||
// LoadParametersAndConst for all the graphs that have been run in the current step
|
||||
if (debugger_ && device_target_ == kGPUDevice) {
|
||||
for (auto graph : graph_ptr_step_vec_) {
|
||||
|
@ -543,7 +534,7 @@ void Debugger::PostExecute() {
|
|||
if (debug_services_ != nullptr) {
|
||||
debug_services_->ResetLoadedTensors();
|
||||
} else {
|
||||
MS_LOG(ERROR) << "debug_services_ is nullptr";
|
||||
MS_LOG(DEBUG) << "debug_services_ is nullptr";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -184,6 +184,25 @@ std::string CheckDatasetSinkMode(const KernelGraphPtr &graph_ptr) {
|
|||
return error_info;
|
||||
}
|
||||
|
||||
void LoadDataForDump(const KernelGraphPtr &graph_ptr) {
|
||||
auto context = MsContext::GetInstance();
|
||||
MS_EXCEPTION_IF_NULL(context);
|
||||
if (context->get_param<std::string>(MS_CTX_DEVICE_TARGET) != kAscendDevice) {
|
||||
return;
|
||||
}
|
||||
#ifdef ENABLE_DEBUGGER
|
||||
MS_LOG(INFO) << "Start load step";
|
||||
auto debugger = Debugger::GetInstance();
|
||||
MS_EXCEPTION_IF_NULL(debugger);
|
||||
debugger->SetGraphPtr(graph_ptr);
|
||||
// load output
|
||||
debugger->LoadGraphOutputs();
|
||||
// load parameters
|
||||
debugger->LoadParametersAndConst();
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef ENABLE_D
|
||||
int32_t DumpDataCallBack(const DumpChunk *dump_chunk, int32_t size) {
|
||||
MS_LOG(DEBUG) << "ADX DumpDataCallBack is called";
|
||||
|
|
|
@ -42,6 +42,8 @@ void ReadDataAndDump(const CNodePtr &cnode, const KernelLaunchInfo *launch_info_
|
|||
|
||||
std::string CheckDatasetSinkMode(const KernelGraphPtr &graph_ptr);
|
||||
|
||||
void LoadDataForDump(const KernelGraphPtr &graph_ptr);
|
||||
|
||||
#ifdef ENABLE_D
|
||||
// Callback function to dump ascend async mode
|
||||
int32_t DumpDataCallBack(const DumpChunk *dump_chunk, int32_t size);
|
||||
|
|
|
@ -81,7 +81,9 @@ void DebugActor::DebugForGraph(const KernelGraphPtr &graph, const DeviceContext
|
|||
MS_EXCEPTION_IF_NULL(device_context);
|
||||
MS_EXCEPTION_IF_NULL(op_context);
|
||||
MS_EXCEPTION_IF_NULL(from_aid);
|
||||
|
||||
#ifdef ENABLE_DEBUGGER
|
||||
LoadDataForDump(graph);
|
||||
#endif
|
||||
// Call back to the from actor to process after debug finished.
|
||||
ActorDispatcher::Send(*from_aid, &DebugAwareActor::OnDebugFinish, op_context);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue