update benchmark_app to remove setting UNDEFINED with -hint none (#16695)

* Remove setting ov::hint::PerformanceMode::UNDEFINED from benchmark_app

* update benchmark_app

* update python code and description

* update python code

* fix code style issue

* update python code

* update c++ app
This commit is contained in:
Shen, Wanglei
2023-04-13 22:29:13 +08:00
committed by GitHub
parent c592ecd44e
commit 3461064507
5 changed files with 14 additions and 7 deletions

View File

@@ -166,7 +166,7 @@ Running the application with the ``-h`` or ``--help`` option yields the followin
'throughput' or 'tput': device performance mode will be set to THROUGHPUT.
'cumulative_throughput' or 'ctput': device performance mode will be set to CUMULATIVE_THROUGHPUT.
'latency': device performance mode will be set to LATENCY.
'none': device performance mode will be set to UNDEFINED.
'none': no device performance mode will be set.
Using explicit 'nstreams' or other device-specific options, please set hint to 'none'
-niter <integer> Optional. Number of iterations. If not specified, the number of iterations is calculated depending on a device.
-t Optional. Time in seconds to execute topology.

View File

@@ -44,7 +44,7 @@ static const char hint_message[] =
" 'cumulative_throughput' or 'ctput': device performance mode will be set to "
"CUMULATIVE_THROUGHPUT.\n"
" 'latency': device performance mode will be set to LATENCY.\n"
" 'none': device performance mode will be set to UNDEFINED.\n"
" 'none': no device performance mode will be set.\n"
" Using explicit 'nstreams' or other device-specific options, please set hint to "
"'none'";

View File

@@ -360,13 +360,19 @@ int main(int argc, char* argv[]) {
for (auto& device : devices) {
auto& device_config = config[device];
auto ov_perf_hint = get_performance_hint(device, core);
OPENVINO_SUPPRESS_DEPRECATED_START
if (isFlagSetInCommandLine("hint")) {
// apply command line hint setting and override if hint exists
device_config[ov::hint::performance_mode.name()] = ov_perf_hint;
} else {
if (ov_perf_hint != ov::hint::PerformanceMode::UNDEFINED) {
// apply command line hint setting and override if hint exists
device_config[ov::hint::performance_mode.name()] = ov_perf_hint;
} else {
device_config.erase(ov::hint::performance_mode.name());
}
} else if (ov_perf_hint != ov::hint::PerformanceMode::UNDEFINED) {
// keep hint setting in the config if no hint setting from command line
device_config.emplace(ov::hint::performance_mode(ov_perf_hint));
}
OPENVINO_SUPPRESS_DEPRECATED_END
if (FLAGS_nireq != 0)
device_config[ov::hint::num_requests.name()] = unsigned(FLAGS_nireq);