Skip to content

Commit

Permalink
Cleanups for mlperf inference get-platform-details
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh committed Oct 11, 2024
1 parent c1d6e4d commit b983a6c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
19 changes: 11 additions & 8 deletions script/app-mlperf-inference/_cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,17 @@ deps:

posthook_deps:
- tags: get,mlperf,sut,description #populate system meta information like framework
- tags: get,platform,details
enable_if_any_env:
CM_SUDO_USER:
- yes
CM_GET_PLATFORM_DETAILS:
- yes
skip_if_env:
CM_MLPERF_LOADGEN_MODE:
- accuracy
env:
CM_PLATFORM_DETAILS_FILE_PATH: '<<<CM_MLPERF_OUTPUT_DIR>>>/system_info.txt'

# Order of variations for documentation
variation_groups_order:
Expand Down Expand Up @@ -1052,14 +1063,6 @@ variations:
- mlperf-accuracy-script
- imagenet-accuracy-script
tags: run,accuracy,mlperf,_imagenet
- tags: get,platform,details
enable_if_any_env:
CM_SUDO_USER:
- yes
CM_GET_PLATFORM_DETAILS:
- yes
env:
CM_PLATFORM_DETAILS_FILE_PATH: '<<<CM_MLPERF_OUTPUT_DIR>>>/system_info.txt'

onnxruntime:
group: backend
Expand Down
8 changes: 3 additions & 5 deletions script/get-platform-details/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,16 @@ def preprocess(i):
if os_info['platform'] == "windows":
return {'return':1, 'error':'get-platform-details script not yet supported in windows!'}

print(env['CM_HOST_OS_KERNEL_VERSION'])

if not check_installation("numactl",os_info):
env['CM_INSTALL_NUMACTL'] = 'True'

#if not check_installation("cpupower",os_info):
env['CM_INSTALL_CPUPOWER'] = 'True'

if env.get('CM_PLATFORM_DETAILS_FILE_PATH', '') == '':
env['CM_GET_PLATFORM_DETAILS_FILE_PATH'] = os.path.join(os.getcwd(), "system_info.txt")
if env.get('CM_PLATFORM_DETAILS_FILE_PATH', '') == '':
env['CM_PLATFORM_DETAILS_FILE_PATH'] = os.path.join(os.getcwd(), "system_info.txt")

return {'return':0}
return {'return':0}


def postprocess(i):
Expand Down
7 changes: 4 additions & 3 deletions script/get-platform-details/run.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash

OUTPUT_FILE="system_info.txt"

echo "WARNING: sudo permission is needed to some packages for measuring the platform details"
OUTPUT_FILE="$CM_PLATFORM_DETAILS_FILE_PATH"
set -e
#echo $OUTPUT_FILE
echo "WARNING: sudo permission is needed for some of the below commands"

if [[ ${CM_HOST_OS_FLAVOR} == "macos" ]]; then
echo "WARNING: To be done for the mac os"
Expand Down

0 comments on commit b983a6c

Please sign in to comment.