Skip to content

Commit

Permalink
Merge pull request #468 from GATEOverflow/mlperf-inference
Browse files Browse the repository at this point in the history
Fix Nvidia mlperf inference retinanet | onnx version
  • Loading branch information
arjunsuresh authored Nov 3, 2024
2 parents 81e7e16 + 12b70e6 commit 0fe209f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion script/app-mlperf-inference-nvidia/_cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ variations:
- tags: get,generic-python-lib,_pycocotools
- tags: get,generic-python-lib,_onnx-graphsurgeon
- tags: get,generic-python-lib,_package.onnx
version: 1.13.1
version: 1.14.1
- tags: get,generic-python-lib,_package.sympy

sdxl:
Expand Down
11 changes: 7 additions & 4 deletions script/get-generic-sys-util/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ def preprocess(i):
automation = i['automation']

if env['CM_SYS_UTIL_NAME'] == "psmisc" and env.get('CM_HOST_OS_PACKAGE_MANAGER', '') == "brew":
env['CM_SYS_UTIL_VERSION_CMD_OVERRIDE'] = "brew info pstree > tmp-run.out 2>&1 | grep pstree"
env['CM_SYS_UTIL_VERSION_CMD_OVERRIDE'] = "brew info pstree > tmp-ver.out 2>&1"
env['CM_SYS_UTIL_VERSION_RE'] = r"\\b(\\d+\\.\\d+(?:\\.\\d+)?)\\b"
env['CM_TMP_VERSION_DETECT_GROUP_NUMBER'] = 0

#Use VERSION_CMD and CHECK_CMD if no CHECK_CMD is set
if env.get('CM_SYS_UTIL_VERSION_CMD', '') != '' and env.get('CM_SYS_UTIL_CHECK_CMD', '') == '':
env['CM_SYS_UTIL_CHECK_CMD'] = env['CM_SYS_UTIL_VERSION_CMD']

if env.get('CM_GENERIC_SYS_UTIL_RUN_MODE', '') == "detect":
if env.get('CM_SYS_UTIL_VERSION_CMD', '') != '':
if env.get('CM_SYS_UTIL_VERSION_CMD', '') != '' or env.get('CM_SYS_UTIL_VERSION_CMD_OVERRIDE', '') != '':
r = automation.run_native_script({'run_script_input':i['run_script_input'], 'env':env, 'script_name':'detect'})
if r['return'] != 0: #detection failed, do install via prehook_deps
print("detection failed, going for installation")
Expand Down Expand Up @@ -130,10 +133,10 @@ def postprocess(i):

version_env_key = f"CM_{env['CM_SYS_UTIL_NAME'].upper()}_VERSION"

if env.get('CM_SYS_UTIL_VERSION_CMD', '') != '' and (env['CM_GENERIC_SYS_UTIL_RUN_MODE'] == "install" or env.get(version_env_key, '') == '') and str(env.get('CM_TMP_GENERIC_SYS_UTIL_PACKAGE_INSTALL_IGNORED', '')).lower() not in ["yes", "1", "true"]:
if (env.get('CM_SYS_UTIL_VERSION_CMD', '') != '' or env.get('CM_SYS_UTIL_VERSION_CMD_OVERRIDE', '') != '') and (env['CM_GENERIC_SYS_UTIL_RUN_MODE'] == "install" and env.get(version_env_key, '') == '') and str(env.get('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'})
if r['return'] > 0 and str(env.get('CM_GENERIC_SYS_UTIL_IGNORE_VERSION_DETECTION_FAILURE', '')).lower() not in [ "1", "yes", "true" ] and str(env.get('CM_TMP_FAIL_SAFE', '')).lower() not in [ "1", "yes", "true" ]:
if r['return'] > 0 and str(env.get('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.'}

r = detect_version(i)
Expand Down
5 changes: 4 additions & 1 deletion script/get-generic-sys-util/detect.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash

if [[ -n "${CM_SYS_UTIL_VERSION_CMD_OVERRIDE}" ]]; then
eval "${CM_SYS_UTIL_VERSION_CMD_OVERRIDE}"
cmd="${CM_SYS_UTIL_VERSION_CMD_OVERRIDE}"
echo $cmd
eval $cmd
test $? -eq 0 || exit $?
else
if [[ -n "${CM_SYS_UTIL_VERSION_CMD}" ]]; then
Expand Down
1 change: 1 addition & 0 deletions script/get-generic-sys-util/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ if ! eval "$cmd"; then
echo "Command failed with status $?"
if [[ "${CM_TMP_FAIL_SAFE}" == 'yes' ]]; then
# Exit safely if fail-safe is enabled
echo "CM_GET_GENERIC_SYS_UTIL_INSTALL_FAILED=yes" > tmp-run.out
echo "Fail-safe is enabled, exiting with status 0"
exit 0
else
Expand Down

0 comments on commit 0fe209f

Please sign in to comment.