From 22fe4b2cec44c122f1674f2853af738f4c8c619f Mon Sep 17 00:00:00 2001 From: l00444296 Date: Mon, 28 Dec 2020 20:45:56 +0800 Subject: [PATCH] Feature: delete compress_weight_conf para of aclgrphParse interface --- parser/common/acl_graph_parser_util.cc | 54 +------------------------- parser/common/acl_graph_parser_util.h | 1 - 2 files changed, 1 insertion(+), 54 deletions(-) diff --git a/parser/common/acl_graph_parser_util.cc b/parser/common/acl_graph_parser_util.cc index 028f6ce..a9fe017 100644 --- a/parser/common/acl_graph_parser_util.cc +++ b/parser/common/acl_graph_parser_util.cc @@ -406,53 +406,6 @@ domi::Status AclGrphParseUtil::ParseAclInputFp16Nodes(const ComputeGraphPtr &gra return SUCCESS; } -domi::Status AclGrphParseUtil::ParseAclWeightCompressConf(const ComputeGraphPtr &graph, - const string &compress_weight_conf) { - GE_CHECK_NOTNULL(graph); - if (compress_weight_conf.empty()) { - return SUCCESS; - } - std::string real_path = ge::parser::RealPath(compress_weight_conf.c_str()); - if (real_path.empty()) { - ErrorManager::GetInstance().ATCReportErrMessage("E10016", {"parameter", "opname"}, - {"compress_weight_conf", compress_weight_conf}); - GELOGE(PARAM_INVALID, "Can not get real path for %s.", compress_weight_conf.c_str()); - return PARAM_INVALID; - } - std::ifstream ifs(real_path); - if (!ifs.is_open()) { - ErrorManager::GetInstance().ATCReportErrMessage("E10016", {"parameter", "opname"}, - {"compress_weight_conf", compress_weight_conf}); - GELOGE(FAILED, "Open file %s failed", compress_weight_conf.c_str()); - return FAILED; - } - - std::string compress_nodes; - ifs >> compress_nodes; - ifs.close(); - if (compress_nodes.empty()) { - GELOGW("Compress weight of nodes info is empty"); - return SUCCESS; - } - GELOGI("Compress weight of nodes: %s", compress_nodes.c_str()); - - vector compress_node_vec = StringUtils::Split(compress_nodes, ';'); - for (size_t i = 0; i < compress_node_vec.size(); ++i) { - ge::NodePtr node = graph->FindNode(compress_node_vec[i]); - if (node == nullptr) { - GELOGW("Node %s is not in graph", compress_node_vec[i].c_str()); - continue; - } - auto op_desc = node->GetOpDesc(); - GE_CHECK_NOTNULL(op_desc); - if (!ge::AttrUtils::SetBool(op_desc, ge::ATTR_NAME_COMPRESS_WEIGHT, true)) { - GELOGE(domi::FAILED, "Node %s SetBool failed.", compress_node_vec[i].c_str()); - return domi::FAILED; - } - } - return SUCCESS; -} - void AclGrphParseUtil::GetOutputNodesNameAndIndex(std::vector> &output_nodes_info, std::vector &output_nodes_name) { output_nodes_name.clear(); @@ -641,7 +594,7 @@ domi::Status AclGrphParseUtil::ParseParamsBeforeGraph(const std::map &parser_params) { - // support paragrams: input_fp16_nodes, is_input_adjust_hw_layout, compress_weight_conf, + // support paragrams: input_fp16_nodes, is_input_adjust_hw_layout, ComputeGraphPtr compute_graph = GraphUtils::GetComputeGraph(graph); GE_CHECK_NOTNULL(compute_graph); @@ -654,11 +607,6 @@ domi::Status AclGrphParseUtil::ParseParamsAfterGraph(ge::Graph &graph, ParseAclInputFp16Nodes(compute_graph, input_fp16_nodes, is_input_adjust_hw_layout) != SUCCESS, return PARAM_INVALID, "Parse input_fp16_nodes failed"); - string compress_weight_conf; - GetAclParams(parser_params, ge::ir_option::COMPRESS_WEIGHT_CONF, compress_weight_conf); - GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(ParseAclWeightCompressConf(compute_graph, compress_weight_conf) != SUCCESS, - return PARAM_INVALID, "Parse compress_weight_conf failed"); - return SUCCESS; } diff --git a/parser/common/acl_graph_parser_util.h b/parser/common/acl_graph_parser_util.h index 17a7179..0e68594 100644 --- a/parser/common/acl_graph_parser_util.h +++ b/parser/common/acl_graph_parser_util.h @@ -60,7 +60,6 @@ class AclGrphParseUtil { uint32_t index, OpDescPtr &op_desc); domi::Status ParseAclInputFp16Nodes(const ComputeGraphPtr &graph, const string &input_fp16_nodes, const string &is_input_adjust_hw_layout); - domi::Status ParseAclWeightCompressConf(const ComputeGraphPtr &graph, const string &compress_weight_conf); domi::Status GetDefaultOutInfo(ge::ComputeGraphPtr &compute_graph, std::vector> &output_nodes_info); };