diff --git a/mindspore/ccsrc/device/ascend/ascend_memory_manager.cc b/mindspore/ccsrc/device/ascend/ascend_memory_manager.cc index c2373d3c7e..560893ee51 100644 --- a/mindspore/ccsrc/device/ascend/ascend_memory_manager.cc +++ b/mindspore/ccsrc/device/ascend/ascend_memory_manager.cc @@ -21,8 +21,8 @@ namespace mindspore { namespace device { namespace ascend { -const uint64_t kAscendDeviceMemGB = 20; -const uint64_t kAscendMemPoolGB = 10; +const uint64_t kAscendDeviceMemGB = 24; +const uint64_t kAscendMemPoolGB = 6; const uint64_t kAscendDeviceMemSize = (kAscendDeviceMemGB << 30); const uint64_t kAscendMemPoolSize = (kAscendMemPoolGB << 30); diff --git a/mindspore/ccsrc/device/kernel_runtime.cc b/mindspore/ccsrc/device/kernel_runtime.cc index e77d348630..4ec9638999 100644 --- a/mindspore/ccsrc/device/kernel_runtime.cc +++ b/mindspore/ccsrc/device/kernel_runtime.cc @@ -243,11 +243,17 @@ void KernelRuntime::RunOpAssignWorkSpaceMemory(const AnfNodePtr &kernel) { void KernelRuntime::AssignStaticMemoryInput(const session::KernelGraph *graph) { MS_EXCEPTION_IF_NULL(graph); MS_EXCEPTION_IF_NULL(mem_manager_); - for (auto &item : graph->inputs()) { + auto graph_inputs = graph->inputs(); + auto graph_valid_input = graph->valid_inputs(); + for (size_t i = 0; i < graph_inputs.size(); i++) { + auto item = graph_inputs[i]; MS_EXCEPTION_IF_NULL(item); if (!item->isa()) { continue; } + if (i < graph_valid_input.size() && !graph_valid_input[i]) { + continue; + } if (AnfAlgo::OutputAddrExist(item, 0)) { continue; }