!45658 [Dump]fix the rank id is invalid in case of multi rank on gpu dump

Merge pull request !45658 from maoyaomin/mym_fix_gpu_dump
This commit is contained in:
i-robot 2022-11-17 07:04:17 +00:00 committed by Gitee
commit 86558b2faa
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 9 additions and 9 deletions

View File

@ -85,15 +85,6 @@ void GPUDeviceContext::Initialize() {
auto gpu_kernel_executor = dynamic_cast<GPUKernelExecutor *>(kernel_executor_.get());
MS_EXCEPTION_IF_NULL(gpu_kernel_executor);
gpu_kernel_executor->Initialize();
#ifndef ENABLE_SECURITY
// Dump json config file if dump is enabled.
auto rank_id = gpu_kernel_executor->GetRankID();
auto &json_parser = DumpJsonParser::GetInstance();
json_parser.Parse();
json_parser.CopyDumpJsonToDir(rank_id);
json_parser.CopyMSCfgJsonToDir(rank_id);
#endif
initialized_ = true;
}
@ -129,6 +120,15 @@ void GPUDeviceResManager::Initialize() {
GPUDeviceManager::GetInstance().default_stream_id());
}
#ifndef ENABLE_SECURITY
// Dump json config file if dump is enabled.
auto rank_id = device_context_->device_context_key().device_id_;
auto &json_parser = DumpJsonParser::GetInstance();
json_parser.Parse();
json_parser.CopyDumpJsonToDir(rank_id);
json_parser.CopyMSCfgJsonToDir(rank_id);
#endif
// Initialize NCCL.
if (distributed::collective::CollectiveManager::instance()->initialized()) {
#if defined(_WIN32)