Browse Source

!26206 adapt ascend unified runtime in profiler

Merge pull request !26206 from yanghaitao/yht_adapt_ascend_runtime
tags/v1.6.0
i-robot Gitee 4 years ago
parent
commit
41844a25a8
1 changed files with 17 additions and 0 deletions
  1. +17
    -0
      mindspore/ccsrc/runtime/hardware/ascend/ascend_device_context.cc

+ 17
- 0
mindspore/ccsrc/runtime/hardware/ascend/ascend_device_context.cc View File

@@ -45,6 +45,14 @@
#include "debug/rdr/graph_recorder.h"
#endif

#ifndef ENABLE_SECURITY
#include "profiler/device/ascend/memory_profiling.h"
#include "runtime/device/ascend/profiling/profiling_manager.h"

using mindspore::device::ascend::ProfilingManager;
using mindspore::profiler::ascend::MemoryProfiling;
#endif

namespace mindspore {
namespace device {
namespace ascend {
@@ -406,6 +414,15 @@ void AscendDeviceContext::AllocateGraphMemory(const NotNull<KernelGraphPtr> &roo
mem_manager_->ResetDynamicMemory();
runtime_instance_->AssignDynamicMemory(*root_graph.get());
runtime_instance_->UpdateRefNodeOutputMem(*root_graph.get());

#ifndef ENABLE_SECURITY
auto profiling_instance = MemoryProfiling::GetInstance();
if (profiling_instance.IsMemoryProfilingEnable()) {
uint64_t mem_size = runtime_instance_->GetAvailableMemMaxSize();
profiling_instance.SetDeviceMemSize(mem_size);
profiling_instance.SaveMemoryProfiling();
}
#endif
}

void AscendDeviceContext::AssignInputMemory(const NotNull<KernelGraphPtr> &graph,


Loading…
Cancel
Save