[benchmark] add disable_mkldnn option for paddle infer backend to support 3D model benchmark (#1866)

[benchmark] add disable_mkldnn option for paddle infer backend to support 3D model
This commit is contained in:
DefTruth
2023-04-25 10:43:08 +08:00
committed by GitHub
parent eb00817598
commit 37794d5f45

View File

@@ -39,6 +39,7 @@ DEFINE_string(params_file, "", "Optional, set specific params file,"
"eg, model.pdiparams.");
DEFINE_string(model_format, "PADDLE", "Optional, set specific model format,"
"eg, PADDLE/ONNX/RKNN/TORCHSCRIPT/SOPHGO");
DEFINE_bool(disable_mkldnn, false, "disable mkldnn for paddle backend");
#if defined(ENABLE_BENCHMARK)
static std::vector<int64_t> GetInt64Shape(const std::vector<int>& shape) {
@@ -88,6 +89,9 @@ static void RuntimeProfiling(int argc, char* argv[]) {
if (!CreateRuntimeOption(&option, argc, argv, true)) {
return;
}
if (FLAGS_disable_mkldnn) {
option.paddle_infer_option.enable_mkldnn = false;
}
std::unordered_map<std::string, std::string> config_info;
benchmark::ResultManager::LoadBenchmarkConfig(FLAGS_config_path,
&config_info);