Browse Source

!8601 independent node use the somas's memory

From: @laiyongqiang
Reviewed-by: @kisnwang,@jjfeing
Signed-off-by: @jjfeing
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
07633f2a2a
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      mindspore/ccsrc/backend/optimizer/somas/somas.cc
  2. +1
    -1
      mindspore/ccsrc/runtime/device/kernel_runtime.cc

+ 1
- 1
mindspore/ccsrc/backend/optimizer/somas/somas.cc View File

@@ -301,7 +301,7 @@ void Somas::IndependentNodeOutputProcess(const session::KernelGraph *graph) {
auto semi_reuse_output_tensors = iter->second->output_tensors_; auto semi_reuse_output_tensors = iter->second->output_tensors_;
for (auto &tensor : semi_reuse_output_tensors) { for (auto &tensor : semi_reuse_output_tensors) {
total_size += tensor->GetAlignedSize(); total_size += tensor->GetAlignedSize();
tensor->aligned_size_ = 0;
tensor->lifelong_value_ = kLifeLongGraphAll;
} }
} }
} }


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

@@ -543,7 +543,7 @@ void KernelRuntime::AssignNodeOutputMem(MemType type, const AnfNodePtr &node, in


if (node->isa<CNode>()) { if (node->isa<CNode>()) {
bool independent = AnfAlgo::IsIndependentNode(node->cast<CNodePtr>()); bool independent = AnfAlgo::IsIndependentNode(node->cast<CNodePtr>());
if (independent && (type == kReuseDynamicMem || type == kSomasReuseDynamicMem)) {
if (independent && (type == kReuseDynamicMem)) {
MS_LOG(INFO) << "Independent node " << node->fullname_with_scope() << " disable memory reuse"; MS_LOG(INFO) << "Independent node " << node->fullname_with_scope() << " disable memory reuse";
type = kDynamicMem; type = kDynamicMem;
} }


Loading…
Cancel
Save