From 37794d5f45709e715da7f244b59d202e5aa7077c Mon Sep 17 00:00:00 2001 From: DefTruth <31974251+DefTruth@users.noreply.github.com> Date: Tue, 25 Apr 2023 10:43:08 +0800 Subject: [PATCH] [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 --- benchmark/cpp/benchmark.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/benchmark/cpp/benchmark.cc b/benchmark/cpp/benchmark.cc index 4629ad458..eedc30fa7 100755 --- a/benchmark/cpp/benchmark.cc +++ b/benchmark/cpp/benchmark.cc @@ -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 GetInt64Shape(const std::vector& 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 config_info; benchmark::ResultManager::LoadBenchmarkConfig(FLAGS_config_path, &config_info);