use super kernel to load data for ascend dump

This commit is contained in:
Parastoo Ashtari 2021-12-14 10:25:49 -05:00
parent f035ed656c
commit 0f41e3ae68
4 changed files with 25 additions and 11 deletions

View File

@ -476,15 +476,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_) {
@ -536,7 +527,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";
}
}
}

View File

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

View File

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

View File

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