From ecf11d19fcd748c455809990247e0a4fa69cf1a6 Mon Sep 17 00:00:00 2001 From: "wangwenhua1@huawei.com" Date: Thu, 24 Dec 2020 11:51:30 +0800 Subject: [PATCH] display model info --- ge/generator/ge_generator.cc | 66 ------------------------------------ 1 file changed, 66 deletions(-) diff --git a/ge/generator/ge_generator.cc b/ge/generator/ge_generator.cc index a509c879..bd904698 100644 --- a/ge/generator/ge_generator.cc +++ b/ge/generator/ge_generator.cc @@ -557,71 +557,6 @@ bool GeGenerator::Impl::SetOmSystemInfo(AttrHolder &obj) { return true; } -void GeGenerator::Impl::DisplayModelInfo(AttrHolder &obj) { - std::string display_model; - (void)ge::GetContext().GetOption(ge::DISPLAY_MODEL_INFO, display_model); - if (display_model != "1") { - GELOGD("display_model not 1"); - return; - } - - std::cout << "------------ Display Model Info start ------------" << std::endl; - // system info - std::string atc_version; - (void)ge::AttrUtils::GetStr(obj, ATTR_MODEL_ATC_VERSION, atc_version); - std::string soc_version; - (void)ge::AttrUtils::GetStr(obj, "soc_version", soc_version); - std::string framework_type; - (void)ge::AttrUtils::GetStr(obj, "framework_type", framework_type); - std::cout << "system info: " - << ATTR_MODEL_ATC_VERSION - << "[" << atc_version << "], " - << "soc_version" - << "[" << soc_version << "], " - << "framework_type" - << "[" << framework_type << "]." << std::endl; - - // resource info - int64_t memory_size; - (void)ge::AttrUtils::GetInt(obj, ATTR_MODEL_MEMORY_SIZE, memory_size); - int64_t weight_size; - (void)ge::AttrUtils::GetInt(obj, ATTR_MODEL_WEIGHT_SIZE, weight_size); - int64_t stream_num; - (void)ge::AttrUtils::GetInt(obj, ATTR_MODEL_STREAM_NUM, stream_num); - int64_t event_num; - (void)ge::AttrUtils::GetInt(obj, ATTR_MODEL_EVENT_NUM, event_num); - std::cout << "resource info: " - << ATTR_MODEL_MEMORY_SIZE - << "[" << memory_size << "], " - << ATTR_MODEL_WEIGHT_SIZE - << "[" << weight_size << "], " - << ATTR_MODEL_STREAM_NUM - << "[" << stream_num << "], " - << ATTR_MODEL_EVENT_NUM - << "[" << event_num << "]." - << std::endl; - - vector om_info; - (void)ge::AttrUtils::GetListInt(obj, "om_info_list", om_info); - if (om_info.size() == kOmInfoSize) { - std::cout << "om info: " - << "modeldef_size" - << "[" << om_info[0] << "], " - << "weight_data_size" - << "[" << om_info[1] << "], " - << "tbe_kernels_size" - << "[" << om_info[2] << "], " - << "cust_aicpu_kernel_store_size" - << "[" << om_info[3] << "], " - << "task_info_size" - << "[" << om_info[4] << "]." << std::endl; - } else { - std::cout << "Display Model Info failed, please check!" << std::endl; - }; - - std::cout << "------------ Display Model Info end ------------" << std::endl; -} - Status GeGenerator::GenerateModel(const Graph &graph, const string &file_name_prefix, const vector &inputs, ModelBufferData &model, bool is_offline) { rtContext_t ctx = nullptr; @@ -928,7 +863,6 @@ Status GeGenerator::Impl::SaveRootModel(const string &file_name_prefix, GeRootMo GELOGE(ret, "Save to om model failed"); return ret; } - // DisplayModelInfo(*(model_root.get())); return SUCCESS; }