Modify for CVS-69023(python version): hint configuration (#10312)

Signed-off-by: xuejun <xuejun.zhai@intel.com>
This commit is contained in:
Xuejun Zhai
2022-02-18 09:40:27 +08:00
committed by GitHub
parent 2d88e67616
commit 9b36daf23b
3 changed files with 27 additions and 16 deletions

View File

@@ -99,11 +99,15 @@ Options:
-c PATH_TO_CLDNN_CONFIG, --path_to_cldnn_config PATH_TO_CLDNN_CONFIG
Optional. Required for GPU custom kernels. Absolute
path to an .xml file with the kernels description.
-hint {throughput, latency}, --perf_hint {throughput, latency}
Optional. Performance hint (optimize for latency or throughput).
The hint allows the OpenVINO device to select the right network-specific settings,
as opposite to defining specific values like \nstreams\ from the command line.
So you can specify just the hint without adding explicit device-specific options.
-hint {throughput, latency, none}, --perf_hint {throughput, latency, none}
Optional. Performance hint (latency or throughput or
none). Performance hint allows the OpenVINO device to
select the right network-specific settings.
'throughput': device performance mode will be set to
THROUGHPUT. 'latency': device performance mode will be
set to LATENCY. 'none': no device performance mode
will be set. Using explicit 'nstreams' or other
device-specific options, please set hint to 'none'
-api {sync,async}, --api_type {sync,async}
Optional. Enable using sync/async API. Default value
is async.

View File

@@ -80,13 +80,19 @@ def run(args):
cldnn_config = config[GPU_DEVICE_NAME]['CONFIG_FILE']
benchmark.add_extension(path_to_cldnn_config=cldnn_config)
if not args.perf_hint:
for device in devices:
supported_properties = benchmark.core.get_property(device, 'SUPPORTED_PROPERTIES')
if 'PERFORMANCE_HINT' in supported_properties:
logger.warning(f"-hint default value is determined as 'THROUGHPUT' automatically for {device} device" +
"For more detailed information look at README.")
for device in devices:
supported_properties = benchmark.core.get_property(device, 'SUPPORTED_PROPERTIES')
if 'PERFORMANCE_HINT' in supported_properties:
if is_flag_set_in_command_line('hint'):
if args.perf_hint=='none':
logger.warning(f"No device {device} performance hint is set.")
args.perf_hint = ""
else:
logger.warning(f"PerformanceMode was not explicitly specified in command line. " +
f"Device {device} performance hint will be set to THROUGHPUT.")
args.perf_hint = "throughput"
else:
logger.warning(f"Device {device} does not support performance hint property(-hint).")
version = benchmark.get_version_info()

View File

@@ -50,11 +50,12 @@ def parse_args():
args.add_argument('-c', '--path_to_cldnn_config', type=str, required=False,
help='Optional. Required for GPU custom kernels. Absolute path to an .xml file with the '
'kernels description.')
args.add_argument('-hint', '--perf_hint', type=str, required=False, default='', choices=['throughput', 'latency'],
help='Optional. Performance hint (optimize for latency or throughput). '
'The hint allows the OpenVINO device to select the right network-specific settings, '
'as opposite to accepting specific values like \'nstreams\' from the command line. '
'So you can specify just the hint without adding explicit device-specific options')
args.add_argument('-hint', '--perf_hint', type=str, required=False, default='', choices=['throughput', 'latency', 'none'],
help='Optional. Performance hint (latency or throughput or none). Performance hint allows the OpenVINO device to select the right network-specific settings.\n'
'\'throughput\': device performance mode will be set to THROUGHPUT. \n'
'\'latency\': device performance mode will be set to LATENCY. \n'
'\'none\': no device performance mode will be set. \n'
'Using explicit \'nstreams\' or other device-specific options, please set hint to \'none\'')
args.add_argument('-api', '--api_type', type=str, required=False, default='async', choices=['sync', 'async'],
help='Optional. Enable using sync/async API. Default value is async.')
args.add_argument('-niter', '--number_iterations', type=check_positive, required=False, default=None,