Browse Source

!1916 op_select_implmode support high_precision_for_all and high_performance_for_all

Merge pull request !1916 from lianghuikang/op_select_implmode
tags/v1.5.1
i-robot Gitee 3 years ago
parent
commit
00e3b747a3
2 changed files with 11 additions and 5 deletions
  1. +7
    -2
      ge/ir_build/option_utils.cc
  2. +4
    -3
      ge/offline/main.cc

+ 7
- 2
ge/ir_build/option_utils.cc View File

@@ -50,6 +50,8 @@ const std::set<std::string> kBufferOptimizeSupportOption = {"l1_optimize", "l2_o
const char *const kBufferOptimizeSupport = "only support l2_optimize, off_optimize";
const char *const IR_OPTION_OP_SELECT_IMPLMODE_DEFAULT = "high_performance";
const char *const IR_OPTION_OP_SELECT_IMPLMODE_PRECISON = "high_precision";
const char *const IR_OPTION_OP_SELECT_IMPLMODE_HIGH_PRECISION_FOR_ALL = "high_precision_for_all";
const char *const IR_OPTION_OP_SELECT_IMPLMODE_HIGH_PERFORMANCE_FOR_ALL = "high_performance_for_all";
const char *const kInputShapeSample1 = "\"input_name1:n1,c1,h1,w1\"";
const char *const kInputShapeSample2 = "\"input_name1:1,3,224,224\"";
const char *const kSplitError1 = "size not equal to 2 split by \":\"";
@@ -57,7 +59,8 @@ const char *const kEmptyError = "can not be empty";
const char *const kFloatNumError = "exist float number";
const char *const kDigitError = "is not digit";
const char *const kCompressWeightError = "it must be appointed when appoint parameter[--optypelist_for_implmode]";
const char *const kSelectImplmodeError = "only support high_performance, high_precision";
const char *const kSelectImplmodeError = "only support high_performance, high_precision, "
"high_precision_for_all, high_performance_for_all";
const char *const kDynamicBatchSizeError = "It can only contains digit, \",\", \" \"";
const char *const kDynamicImageSizeError = "It can only contains digit, \",\", \" \" and \";\"";
const char *const kKeepDtypeError = "file not found";
@@ -782,7 +785,9 @@ Status CheckImplmodeParamValid(const std::string &optypelist_for_implmode, std::
op_select_implmode = IR_OPTION_OP_SELECT_IMPLMODE_DEFAULT;
} else {
if (op_select_implmode != IR_OPTION_OP_SELECT_IMPLMODE_DEFAULT &&
op_select_implmode != IR_OPTION_OP_SELECT_IMPLMODE_PRECISON) {
op_select_implmode != IR_OPTION_OP_SELECT_IMPLMODE_PRECISON &&
op_select_implmode != IR_OPTION_OP_SELECT_IMPLMODE_HIGH_PRECISION_FOR_ALL &&
op_select_implmode != IR_OPTION_OP_SELECT_IMPLMODE_HIGH_PERFORMANCE_FOR_ALL) {
ErrorManager::GetInstance().ATCReportErrMessage("E10001", {"parameter", "value", "reason"},
{"--op_select_implmode", op_select_implmode.c_str(),
kSelectImplmodeError});


+ 4
- 3
ge/offline/main.cc View File

@@ -143,7 +143,8 @@ DEFINE_string(output_type, "",

DEFINE_string(op_select_implmode, "",
"Optional; op select implmode! "
"Support high_precision, high_performance.");
"Support high_precision, high_performance, "
"high_precision_for_all, high_performance_for_all.");

DEFINE_string(optypelist_for_implmode, "",
"Optional; Nodes need use implmode selected in op_select_implmode "
@@ -311,8 +312,8 @@ class GFlagUtils {
"scenarios by using a configuration file.\n"
" --auto_tune_mode Set tune mode. E.g.: \"GA,RL\", support configure multiple, spit by ,\n"
" --op_bank_path Set the path of the custom repository generated after operator tuning with Auto Tune.\n"
" --op_select_implmode Set op select implmode. Support high_precision, high_performance. "
"default: high_performance\n"
" --op_select_implmode Set op select implmode. Support high_precision, high_performance, "
"high_precision_for_all, high_performance_for_all. default: high_performance\n"
" --optypelist_for_implmode Appoint which op to select implmode, cooperated with op_select_implmode.\n"
" Separate multiple nodes with commas (,). Use double quotation marks (\") "
"to enclose each argument. E.g.: \"node_name1,node_name2\"\n"


Loading…
Cancel
Save