diff --git a/automation/script/module_misc.py b/automation/script/module_misc.py index db42a322ee..9cae72b07b 100644 --- a/automation/script/module_misc.py +++ b/automation/script/module_misc.py @@ -1251,12 +1251,14 @@ def regenerate_script_cmd(i): # Cleanup from env everything that has a host path value if i_run_cmd.get('env'): for key in list(i_run_cmd.get('env')): - if isinstance(i_run_cmd['env'][key], str) and ((os.path.join("local", "cache", "") in i_run_cmd['env'][key]) or (os.path.join("CM", "repos", "") in i_run_cmd['env'][key])): + if isinstance(i_run_cmd['env'][key], str) and ((os.path.join("local", "cache", "") in i_run_cmd['env'][key]) or ( + os.path.join("CM", "repos", "") in i_run_cmd['env'][key])): del (i_run_cmd['env'][key]) elif isinstance(i_run_cmd['env'][key], list): values_to_remove = [] for val in i_run_cmd['env'][key]: - if isinstance(val, str) and ((os.path.join("local", "cache", "") in val) or (os.path.join("CM", "repos", "") in val)): + if isinstance(val, str) and ((os.path.join("local", "cache", "") in val) or ( + os.path.join("CM", "repos", "") in val)): values_to_remove.append(val) if values_to_remove == i_run_cmd['env'][key]: del (i_run_cmd['env'][key]) diff --git a/script/get-generic-sys-util/customize.py b/script/get-generic-sys-util/customize.py index 6b69e52d85..794a529b96 100644 --- a/script/get-generic-sys-util/customize.py +++ b/script/get-generic-sys-util/customize.py @@ -77,7 +77,7 @@ def preprocess(i): if util == "libffi": if env.get("CM_HOST_OS_FLAVOR", "") == "ubuntu": if env.get("CM_HOST_OS_VERSION", "") in [ - "20.04", "20.10", "21.04", "21.10"]: + "20.04", "20.10", "21.04", "21.10"]: package_name = "libffi7" else: package_name = "libffi8" @@ -87,10 +87,11 @@ def preprocess(i): for tmp_value in tmp_values: if tmp_value not in env: return {'return': 1, - 'error': 'variable {} is not in env'.format(tmp_value)} + 'error': 'variable {} is not in env'.format(tmp_value)} if tmp_value in env: if isinstance(package_name, str): - package_name = package_name.replace("<<<" + tmp_value + ">>>", str(env[tmp_value])) + package_name = package_name.replace( + "<<<" + tmp_value + ">>>", str(env[tmp_value])) install_cmd = env.get('CM_HOST_OS_PACKAGE_MANAGER_INSTALL_CMD') if not install_cmd: @@ -111,7 +112,7 @@ def preprocess(i): env['+PATH'] = ["/opt/rh/gcc-toolset-12/root/usr/bin"] if env['CM_SYS_UTIL_NAME'] == "numactl" and env['CM_HOST_OS_VERSION'] in [ - "9.1", "9.2", "9.3"]: + "9.1", "9.2", "9.3"]: env['CM_SYS_UTIL_INSTALL_CMD'] = '' if env.get('CM_SYS_UTIL_CHECK_CMD', @@ -156,9 +157,10 @@ def postprocess(i): 'CM_TMP_GENERIC_SYS_UTIL_PACKAGE_INSTALL_IGNORED', '')).lower() not in ["yes", "1", "true"] and env.get('CM_GET_GENERIC_SYS_UTIL_INSTALL_FAILED', '') != 'yes': automation = i['automation'] - r = automation.run_native_script({'run_script_input': i['run_script_input'], 'env': env, 'script_name': 'detect'}) + r = automation.run_native_script( + {'run_script_input': i['run_script_input'], 'env': env, 'script_name': 'detect'}) if r['return'] > 0 and str(env.get( - 'CM_GENERIC_SYS_UTIL_IGNORE_VERSION_DETECTION_FAILURE', '')).lower() not in ["1", "yes", "true"]: + 'CM_GENERIC_SYS_UTIL_IGNORE_VERSION_DETECTION_FAILURE', '')).lower() not in ["1", "yes", "true"]: return {'return': 1, 'error': 'Version detection failed after installation. Please check the provided version command or use env.CM_GENERIC_SYS_UTIL_IGNORE_VERSION_DETECTION_FAILURE=yes to ignore the error.'} elif r['return'] == 0: @@ -172,8 +174,8 @@ def postprocess(i): env[version_env_key] = version # Not used now - env['CM_GENERIC_SYS_UTIL_' + env['CM_SYS_UTIL_NAME'].upper() + \ - '_CACHE_TAGS'] = 'version-' + version + env['CM_GENERIC_SYS_UTIL_' + env['CM_SYS_UTIL_NAME'].upper() + + '_CACHE_TAGS'] = 'version-' + version if env.get(version_env_key, '') == '': env[version_env_key] = "undetected" diff --git a/script/test-cm-core/src/tutorials/test_tutorial_retinanet.py b/script/test-cm-core/src/tutorials/test_tutorial_retinanet.py index 136f5e6f2e..0b96f17f5a 100644 --- a/script/test-cm-core/src/tutorials/test_tutorial_retinanet.py +++ b/script/test-cm-core/src/tutorials/test_tutorial_retinanet.py @@ -11,7 +11,7 @@ os.path.join( Path(__file__).parent.parent.resolve(), "script")) -import check as checks # noqa +import check as checks # noqa r = cm.access({'action': 'run', 'automation': 'script', 'tags': 'app,mlperf,inference,generic,_cpp,_retinanet,_onnxruntime,_cpu', 'adr': {'python': {'version_min': '3.8'}, 'compiler': {'tags': "gcc"}, 'openimages-preprocessed': {'tags': '_50'}}, 'scenario': 'Offline', diff --git a/script/test-cm-core/src/tutorials/test_tutorial_tvm.py b/script/test-cm-core/src/tutorials/test_tutorial_tvm.py index 38b812d6b1..4b621ebe80 100644 --- a/script/test-cm-core/src/tutorials/test_tutorial_tvm.py +++ b/script/test-cm-core/src/tutorials/test_tutorial_tvm.py @@ -12,7 +12,7 @@ os.path.join( Path(__file__).parent.parent.resolve(), "script")) -import check as checks # noqa +import check as checks # noqa r = cm.access({'action': 'run', 'automation': 'script', 'tags': 'run,mlperf,inference,generate-run-cmds', 'adr': {'python': {'name': 'mlperf', 'version_min': '3.8'}}, 'submitter': 'Community', diff --git a/script/test-cm-core/src/tutorials/test_tutorial_tvm_pip_ge.py b/script/test-cm-core/src/tutorials/test_tutorial_tvm_pip_ge.py index d6db8c798a..692ddeb830 100644 --- a/script/test-cm-core/src/tutorials/test_tutorial_tvm_pip_ge.py +++ b/script/test-cm-core/src/tutorials/test_tutorial_tvm_pip_ge.py @@ -9,7 +9,7 @@ os.path.join( Path(__file__).parent.parent.resolve(), "script")) -import check as checks # noqa +import check as checks # noqa r = cm.access({'action': 'run', 'automation': 'script', 'tags': 'run,mlperf,inference,generate-run-cmds', 'adr': {'python': {'name': 'mlperf', 'version_min': '3.8'}, 'tvm': { diff --git a/script/test-cm-core/src/tutorials/test_tutorial_tvm_pip_vm.py b/script/test-cm-core/src/tutorials/test_tutorial_tvm_pip_vm.py index 5554f3c6a0..5758ad08f2 100644 --- a/script/test-cm-core/src/tutorials/test_tutorial_tvm_pip_vm.py +++ b/script/test-cm-core/src/tutorials/test_tutorial_tvm_pip_vm.py @@ -12,7 +12,7 @@ os.path.join( Path(__file__).parent.parent.resolve(), "script")) -import check as checks # noqa +import check as checks # noqa r = cm.access({'action': 'run', 'automation': 'script', 'tags': 'run,mlperf,inference,generate-run-cmds', 'adr': {'python': {'name': 'mlperf', 'version_min': '3.8'}, 'tvm': {'tags': '_pip-install'}}, 'submitter': 'Community', diff --git a/setup.py b/setup.py index b57c0bf3e7..2e65a10546 100644 --- a/setup.py +++ b/setup.py @@ -140,7 +140,11 @@ def command_exists(self, command): def custom_function(self): commit_hash = get_commit_hash() import cmind - r = cmind.access({'action':'rm', 'automation':'repo', 'artifact':'mlcommons@cm4mlops', 'force': True, 'all': True}) + r = cmind.access({'action': 'rm', + 'automation': 'repo', + 'artifact': 'mlcommons@cm4mlops', + 'force': True, + 'all': True}) r = cmind.access({'action': 'pull', 'automation': 'repo', 'artifact': 'mlcommons@cm4mlops',