|
|
|
@@ -26,19 +26,19 @@ |
|
|
|
#include "common/debug/log.h" |
|
|
|
#include "common/op/ge_op_utils.h" |
|
|
|
#include "common/properties_manager.h" |
|
|
|
#include "common/type.h" |
|
|
|
#include "common/types.h" |
|
|
|
#include "common/util.h" |
|
|
|
#include "common/util/error_manager/error_manager.h" |
|
|
|
#include "ge/ge_api_types.h" |
|
|
|
#include "graph/opsproto_manager.h" |
|
|
|
#include "graph/utils/type_utils.h" |
|
|
|
#include "omg/parser/parser_inner_ctx.h" |
|
|
|
#include "tbe_plugin_loader.h" |
|
|
|
#include "framework/common/debug/ge_log.h" |
|
|
|
#include "parser/common/register_tbe.h" |
|
|
|
#include "framework/omg/parser/parser_types.h" |
|
|
|
#include "common/util/error_manager/error_manager.h" |
|
|
|
#include "google/protobuf/io/coded_stream.h" |
|
|
|
#include "google/protobuf/io/zero_copy_stream_impl.h" |
|
|
|
#include "parser/common/register_tbe.h" |
|
|
|
|
|
|
|
using google::protobuf::io::CodedInputStream; |
|
|
|
using google::protobuf::io::FileInputStream; |
|
|
|
@@ -819,11 +819,44 @@ domi::Status AclGrphParseUtil::SetOutputNodeInfo(ge::Graph &graph, |
|
|
|
return domi::SUCCESS; |
|
|
|
} |
|
|
|
|
|
|
|
domi::Status AclGrphParseUtil::ParseAclLogLevel(const std::string &log) { |
|
|
|
if (log.empty()) { |
|
|
|
return SUCCESS; |
|
|
|
} |
|
|
|
int ret = -1; |
|
|
|
if (log == "default") { |
|
|
|
ret = 0; |
|
|
|
} else if (log == "null") { |
|
|
|
ret = dlog_setlevel(-1, DLOG_NULL, 0); |
|
|
|
} else if (log == "debug") { |
|
|
|
ret = dlog_setlevel(-1, DLOG_DEBUG, 1); |
|
|
|
} else if (log == "info") { |
|
|
|
ret = dlog_setlevel(-1, DLOG_INFO, 1); |
|
|
|
} else if (log == "warning") { |
|
|
|
ret = dlog_setlevel(-1, DLOG_WARN, 1); |
|
|
|
} else if (log == "error") { |
|
|
|
ret = dlog_setlevel(-1, DLOG_ERROR, 1); |
|
|
|
} else { |
|
|
|
GELOGE(PARAM_INVALID, "invalid value for log:%s, only support debug, info, warning, error, null", log.c_str()); |
|
|
|
return PARAM_INVALID; |
|
|
|
} |
|
|
|
if (ret != 0) { |
|
|
|
GELOGE(PARAM_INVALID, "Log setlevel fail !"); |
|
|
|
} |
|
|
|
return domi::SUCCESS; |
|
|
|
} |
|
|
|
|
|
|
|
domi::Status AclGrphParseUtil::ParseParamsBeforeGraph(const std::map<std::string, std::string> &parser_params, |
|
|
|
string &graph_name) { |
|
|
|
GELOGI("Parse graph user options start."); |
|
|
|
// support paragrams: input_format, is_dynamic_input, input_shape, out_nodes |
|
|
|
// support paragrams: log, input_format, is_dynamic_input, input_shape, out_nodes |
|
|
|
// is_output_adjust_hw_layout, output, op_name_map, enable_scope_fusion_passes |
|
|
|
string log_level; |
|
|
|
GetAclParams(parser_params, "log", log_level); |
|
|
|
GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(ParseAclLogLevel(log_level) != SUCCESS, |
|
|
|
return PARAM_INVALID, "Parse log_level failed"); |
|
|
|
|
|
|
|
|
|
|
|
string input_format; |
|
|
|
GetAclParams(parser_params, "input_format", input_format); |
|
|
|
GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(ParseAclFormat(input_format) != SUCCESS, |
|
|
|
@@ -871,7 +904,6 @@ domi::Status AclGrphParseUtil::ParseParamsBeforeGraph(const std::map<std::string |
|
|
|
domi::Status AclGrphParseUtil::ParseParamsAfterGraph(ge::Graph &graph, |
|
|
|
const std::map<std::string, std::string> &parser_params) { |
|
|
|
// support paragrams: input_fp16_nodes, is_input_adjust_hw_layout, compress_weight_conf, |
|
|
|
// log |
|
|
|
ComputeGraphPtr compute_graph = GraphUtils::GetComputeGraph(graph); |
|
|
|
|
|
|
|
string input_fp16_nodes; |
|
|
|
|