Browse Source

!14483 Orederd value nodes before allocate memory

From: @laiyongqiang
Reviewed-by: @jjfeing,@zhoufeng54
Signed-off-by: @zhoufeng54
pull/14483/MERGE
mindspore-ci-bot Gitee 5 years ago
parent
commit
d4a0df8a94
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      mindspore/ccsrc/runtime/device/kernel_runtime.cc

+ 8
- 1
mindspore/ccsrc/runtime/device/kernel_runtime.cc View File

@@ -688,7 +688,14 @@ void KernelRuntime::AssignStaticMemoryValueNode(session::KernelGraph *graph) {
MS_LOG(INFO) << "AssignStaticMemoryValueNode start";
auto ms_context = MsContext::GetInstance();
MS_EXCEPTION_IF_NULL(ms_context);
for (auto &value_node : graph->graph_value_nodes()) {
// order the value nodes
std::map<std::string, ValueNodePtr> value_nodes_map;
for (auto &node : graph->graph_value_nodes()) {
value_nodes_map[node->fullname_with_scope()] = node;
}

for (auto &item : value_nodes_map) {
auto value_node = item.second;
MS_EXCEPTION_IF_NULL(value_node);
if (NodeOutputDeviceAddressExist(value_node, 0)) {
MS_LOG(DEBUG) << "value_node[" << value_node->DebugString() << "] address already exist";


Loading…
Cancel
Save