Modify for CVS-69023(python version): hint configuration (#10312)
Signed-off-by: xuejun <xuejun.zhai@intel.com>
This commit is contained in:
@@ -99,11 +99,15 @@ Options:
|
|||||||
-c PATH_TO_CLDNN_CONFIG, --path_to_cldnn_config PATH_TO_CLDNN_CONFIG
|
-c PATH_TO_CLDNN_CONFIG, --path_to_cldnn_config PATH_TO_CLDNN_CONFIG
|
||||||
Optional. Required for GPU custom kernels. Absolute
|
Optional. Required for GPU custom kernels. Absolute
|
||||||
path to an .xml file with the kernels description.
|
path to an .xml file with the kernels description.
|
||||||
-hint {throughput, latency}, --perf_hint {throughput, latency}
|
-hint {throughput, latency, none}, --perf_hint {throughput, latency, none}
|
||||||
Optional. Performance hint (optimize for latency or throughput).
|
Optional. Performance hint (latency or throughput or
|
||||||
The hint allows the OpenVINO device to select the right network-specific settings,
|
none). Performance hint allows the OpenVINO device to
|
||||||
as opposite to defining specific values like \nstreams\ from the command line.
|
select the right network-specific settings.
|
||||||
So you can specify just the hint without adding explicit device-specific options.
|
'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}
|
-api {sync,async}, --api_type {sync,async}
|
||||||
Optional. Enable using sync/async API. Default value
|
Optional. Enable using sync/async API. Default value
|
||||||
is async.
|
is async.
|
||||||
|
|||||||
@@ -80,13 +80,19 @@ def run(args):
|
|||||||
cldnn_config = config[GPU_DEVICE_NAME]['CONFIG_FILE']
|
cldnn_config = config[GPU_DEVICE_NAME]['CONFIG_FILE']
|
||||||
benchmark.add_extension(path_to_cldnn_config=cldnn_config)
|
benchmark.add_extension(path_to_cldnn_config=cldnn_config)
|
||||||
|
|
||||||
if not args.perf_hint:
|
for device in devices:
|
||||||
for device in devices:
|
supported_properties = benchmark.core.get_property(device, 'SUPPORTED_PROPERTIES')
|
||||||
supported_properties = benchmark.core.get_property(device, 'SUPPORTED_PROPERTIES')
|
if 'PERFORMANCE_HINT' in supported_properties:
|
||||||
if 'PERFORMANCE_HINT' in supported_properties:
|
if is_flag_set_in_command_line('hint'):
|
||||||
logger.warning(f"-hint default value is determined as 'THROUGHPUT' automatically for {device} device" +
|
if args.perf_hint=='none':
|
||||||
"For more detailed information look at README.")
|
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"
|
args.perf_hint = "throughput"
|
||||||
|
else:
|
||||||
|
logger.warning(f"Device {device} does not support performance hint property(-hint).")
|
||||||
|
|
||||||
version = benchmark.get_version_info()
|
version = benchmark.get_version_info()
|
||||||
|
|
||||||
|
|||||||
@@ -50,11 +50,12 @@ def parse_args():
|
|||||||
args.add_argument('-c', '--path_to_cldnn_config', type=str, required=False,
|
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 '
|
help='Optional. Required for GPU custom kernels. Absolute path to an .xml file with the '
|
||||||
'kernels description.')
|
'kernels description.')
|
||||||
args.add_argument('-hint', '--perf_hint', type=str, required=False, default='', choices=['throughput', 'latency'],
|
args.add_argument('-hint', '--perf_hint', type=str, required=False, default='', choices=['throughput', 'latency', 'none'],
|
||||||
help='Optional. Performance hint (optimize for latency or throughput). '
|
help='Optional. Performance hint (latency or throughput or none). Performance hint allows the OpenVINO device to select the right network-specific settings.\n'
|
||||||
'The hint allows the OpenVINO device to select the right network-specific settings, '
|
'\'throughput\': device performance mode will be set to THROUGHPUT. \n'
|
||||||
'as opposite to accepting specific values like \'nstreams\' from the command line. '
|
'\'latency\': device performance mode will be set to LATENCY. \n'
|
||||||
'So you can specify just the hint without adding explicit device-specific options')
|
'\'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'],
|
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.')
|
help='Optional. Enable using sync/async API. Default value is async.')
|
||||||
args.add_argument('-niter', '--number_iterations', type=check_positive, required=False, default=None,
|
args.add_argument('-niter', '--number_iterations', type=check_positive, required=False, default=None,
|
||||||
|
|||||||
Reference in New Issue
Block a user