Browse Source

orederd value nodes before allocate memory

tags/v1.3.0
laiyongqiang 5 years ago
parent
commit
4bf386aa9f
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

@@ -680,7 +680,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