-
Notifications
You must be signed in to change notification settings - Fork 73
Add available devices and dtypes selection to runner.py #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,9 +44,20 @@ def get_configs(path: Path) -> List[str]: | |
default='configs/config_example.json', | ||
help='The path to a configuration file or ' | ||
'a directory that contains configuration files') | ||
parser.add_argument('--device', '--devices', default='host cpu gpu none', type=str, nargs='+', | ||
choices=('host', 'cpu', 'gpu', 'none'), | ||
help='Availible execution context devices. ' | ||
'This parameter only marks devices as available, ' | ||
'make sure to add the device to the config file ' | ||
'to run it on a specific device') | ||
parser.add_argument('--dummy-run', default=False, action='store_true', | ||
help='Run configuration parser and datasets generation ' | ||
'without benchmarks running') | ||
parser.add_argument('--dtype', '--dtypes', type=str, default="float32 float64", nargs='+', | ||
choices=("float32", "float64"), | ||
help='Available floating point data types' | ||
'This parameter only marks dtype as available, ' | ||
'make sure to add the dtype parameter to the config file ') | ||
parser.add_argument('--no-intel-optimized', default=False, action='store_true', | ||
help='Use Scikit-learn without Intel optimizations') | ||
parser.add_argument('--output-file', default='results.json', | ||
|
@@ -93,6 +104,28 @@ def get_configs(path: Path) -> List[str]: | |
for params_set in config['cases']: | ||
params = common_params.copy() | ||
params.update(params_set.copy()) | ||
|
||
device = [] | ||
if 'device' not in params: | ||
if 'sklearn' in params['lib']: | ||
logging.info('The device parameter value is not defined in config, ' | ||
'none is used') | ||
Comment on lines
+111
to
+112
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move up from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For now other configs do not support device parameter and such message may be confusing |
||
device = ['none'] | ||
elif not isinstance(params['device'], list): | ||
device = [params['device']] | ||
else: | ||
device = params['device'] | ||
params["device"] = [dv for dv in device if dv in args.device] | ||
|
||
dtype = [] | ||
if 'dtype' not in params: | ||
dtype = ['float64'] | ||
elif not isinstance(params['dtype'], list): | ||
dtype = [params['dtype']] | ||
else: | ||
dtype = params['dtype'] | ||
params['dtype'] = [dt for dt in dtype if dt in args.dtype] | ||
|
||
algorithm = params['algorithm'] | ||
libs = params['lib'] | ||
if not isinstance(libs, list): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of PR scope, but int32 might be added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to add this kind of changes in other PR