Browse Source

fix bug of big static memory

tags/v0.3.0-alpha
chenfei 5 years ago
parent
commit
e9f5aebbc1
2 changed files with 9 additions and 3 deletions
  1. +2
    -2
      mindspore/ccsrc/device/ascend/ascend_memory_manager.cc
  2. +7
    -1
      mindspore/ccsrc/device/kernel_runtime.cc

+ 2
- 2
mindspore/ccsrc/device/ascend/ascend_memory_manager.cc View File

@@ -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);



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

@@ -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<Parameter>()) {
continue;
}
if (i < graph_valid_input.size() && !graph_valid_input[i]) {
continue;
}
if (AnfAlgo::OutputAddrExist(item, 0)) {
continue;
}


Loading…
Cancel
Save