Browse Source

assign graph memory max size and variable memory max size adaptively

tags/v1.5.1
lichun 3 years ago
parent
commit
3fd1070398
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      tests/ut/ge/graph/manager/graph_var_manager_unittest.cc

+ 2
- 2
tests/ut/ge/graph/manager/graph_var_manager_unittest.cc View File

@@ -46,7 +46,7 @@ TEST_F(UtestGraphVarManagerTest, test_set_memory_malloc_size_no_related_option)
}

TEST_F(UtestGraphVarManagerTest, test_set_memory_malloc_size_with_user_specify_graph_mem_max_size) {
const map<string, string> options{{"ge.graphMemoryMaxSize", 1024UL * 1024UL * 1024UL / 2}};
const map<string, string> options{{"ge.graphMemoryMaxSize", "536870912"}};
Status ret = VarManager::Instance(0)->SetMemoryMallocSize(options);
EXPECT_EQ(VarManager::Instance(0)->graph_mem_max_size_, floor(1024UL * 1024UL * 1024UL / 2));
EXPECT_EQ(VarManager::Instance(0)->var_mem_max_size_, floor(1024UL * 1024UL * 1024UL * (5.0f / 32.0f)));
@@ -54,7 +54,7 @@ TEST_F(UtestGraphVarManagerTest, test_set_memory_malloc_size_with_user_specify_g
}

TEST_F(UtestGraphVarManagerTest, test_set_memory_malloc_size_with_user_specify_var_mem_max_size) {
const map<string, string> options{{"ge.variableMemoryMaxSize", 1024UL * 1024UL * 1024UL / 2}};
const map<string, string> options{{"ge.variableMemoryMaxSize", "536870912"}};
Status ret = VarManager::Instance(0)->SetMemoryMallocSize(options);
EXPECT_EQ(VarManager::Instance(0)->graph_mem_max_size_, floor(1024UL * 1024UL * 1024UL * (26.0f / 32.0f)));
EXPECT_EQ(VarManager::Instance(0)->var_mem_max_size_, floor(1024UL * 1024UL * 1024UL / 2));


Loading…
Cancel
Save