From 61b9b3a8ec4e26fe198cf9743ec42df5f1361218 Mon Sep 17 00:00:00 2001 From: lianghao Date: Sat, 14 Nov 2020 10:54:27 +0800 Subject: [PATCH] delete atc memory limit --- .../load/new_model_manager/davinci_model.cc | 5 ++++- ge/offline/main.cc | 20 ------------------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/ge/graph/load/new_model_manager/davinci_model.cc b/ge/graph/load/new_model_manager/davinci_model.cc index f310e18e..d00c2eda 100755 --- a/ge/graph/load/new_model_manager/davinci_model.cc +++ b/ge/graph/load/new_model_manager/davinci_model.cc @@ -88,6 +88,7 @@ const uint32_t kDataMemAlignSizeCompare = 64; const uint32_t kDumpL1FusionOpMByteSize = 2 * 1024 * 1024; const uint32_t kDumpFlagOfL1Fusion = 0; const char *const kDefaultBatchLable = "Batch_default"; +const int32_t kInvalidStream = -1; inline bool IsDataOp(const std::string &node_type) { return node_type == DATA_TYPE || node_type == AIPP_DATA_TYPE || node_type == ANN_DATA_TYPE; @@ -610,7 +611,9 @@ Status DavinciModel::Init(void *dev_ptr, size_t mem_size, void *weight_ptr, size GE_DISMISS_GUARD(stream); stream_list_.push_back(stream); - GELOGD("Stream index:%u, stream:%p.", i, stream); + int32_t rt_stream_id = kInvalidStream; + (void)rtGetStreamId(stream, &rt_stream_id); + GELOGI("Logical stream index:%u, stream:%p, rtstream: %d.", i, stream, rt_stream_id); } for (uint32_t i = 0; i < EventNum(); i++) { diff --git a/ge/offline/main.cc b/ge/offline/main.cc index d72040d7..94514f95 100755 --- a/ge/offline/main.cc +++ b/ge/offline/main.cc @@ -32,7 +32,6 @@ #include "graph/anchor.h" #include "graph/debug/ge_attr_define.h" #include "graph/graph.h" -#include "graph/manager/graph_var_manager.h" #include "graph/op_desc.h" #include "graph/utils/graph_utils.h" #include "graph/utils/type_utils.h" @@ -64,8 +63,6 @@ using std::vector; static bool is_dynamic_input = false; -// 310 limited 8G size -const char *const kGraphMemoryManagerMallocMaxSize = "8*1024*1024*1024"; const char *const kModeSupport = "only support 0(model to framework model), " "1(framework model to json), 3(only pre-check), 5(pbtxt to json)"; const char *const kModelToJsonSupport = "only support 0(Caffe) 3(TensorFlow) 5(Onnx)"; @@ -908,13 +905,6 @@ domi::Status GenerateModel(std::map &options, std::string output return domi::FAILED; } - geRet = ge::VarManager::Instance(0)->SetMemoryMallocSize(options); - if (geRet != ge::SUCCESS) { - GELOGE(ge::FAILED, "SetMemoryMallocSize failed."); - (void)ge::GELib::GetInstance()->Finalize(); - return domi::FAILED; - } - ge::Graph graph; std::vector inputs; if (FLAGS_framework == domi::MINDSPORE) { @@ -1016,7 +1006,6 @@ static void SetEnvForSingleOp(std::map &options) { options.emplace(ge::OP_SELECT_IMPL_MODE, FLAGS_op_select_implmode); options.emplace(ge::OPTYPELIST_FOR_IMPLMODE, FLAGS_optypelist_for_implmode); options.emplace(ge::AUTO_TUNE_MODE, FLAGS_auto_tune_mode); - options.emplace(ge::GRAPH_MEMORY_MAX_SIZE, kGraphMemoryManagerMallocMaxSize); options.emplace(ge::OP_DEBUG_LEVEL, to_string(FLAGS_op_debug_level)); options.emplace(ge::DEBUG_DIR, FLAGS_debug_dir); options.emplace(ge::OP_COMPILER_CACHE_DIR, FLAGS_op_compiler_cache_dir); @@ -1053,13 +1042,6 @@ domi::Status GenerateSingleOp(const std::string& json_file_path) { return domi::FAILED; } - ret = ge::VarManager::Instance(0)->SetMemoryMallocSize(options); - if (ret != ge::SUCCESS) { - GELOGE(ge::FAILED, "SetMemoryMallocSize failed."); - (void)ge::GELib::GetInstance()->Finalize(); - return domi::FAILED; - } - vector build_params; if (ge::SingleOpParser::ParseSingleOpList(json_file_path, build_params) != ge::SUCCESS) { DOMI_LOGE("parse single op json file failed"); @@ -1158,8 +1140,6 @@ domi::Status GenerateOmModel() { (FLAGS_enable_compress_weight == "true") ? ge::kEnableCompressWeightTrue : ge::kEnableCompressWeightFalse)); - options.insert(std::pair(string(ge::GRAPH_MEMORY_MAX_SIZE), kGraphMemoryManagerMallocMaxSize)); - options.insert(std::pair(string(ge::ENABLE_SINGLE_STREAM), FLAGS_enable_single_stream)); options.insert(std::pair(string(ge::DEBUG_DIR), FLAGS_debug_dir));