From 18588b6e65c7b54a7807000e38efee85e7446d8d Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 23 Oct 2024 21:21:26 +0100 Subject: [PATCH 1/3] Added vim-common deps for loadgen build --- script/get-generic-sys-util/_cm.json | 15 +++++++++++++++ script/get-mlperf-inference-loadgen/_cm.yaml | 1 + 2 files changed, 16 insertions(+) diff --git a/script/get-generic-sys-util/_cm.json b/script/get-generic-sys-util/_cm.json index 1bd8266511..a1f9d09918 100644 --- a/script/get-generic-sys-util/_cm.json +++ b/script/get-generic-sys-util/_cm.json @@ -668,6 +668,21 @@ } } }, + "vim-common": { + "env": { + "CM_SYS_UTIL_NAME": "vim_common", + "CM_SYS_UTIL_CHECK_CMD": "xxd --version" + }, + "state": { + "vim_common": { + "apt": "vim-common", + "brew": "vim", + "dnf": "vim-common", + "yum": "vim-common", + "choco": "vim" + } + } + }, "xz": { "env": { "CM_SYS_UTIL_NAME": "xz" diff --git a/script/get-mlperf-inference-loadgen/_cm.yaml b/script/get-mlperf-inference-loadgen/_cm.yaml index 3ce1f83992..49e3b186fe 100644 --- a/script/get-mlperf-inference-loadgen/_cm.yaml +++ b/script/get-mlperf-inference-loadgen/_cm.yaml @@ -76,6 +76,7 @@ deps: - pip-package - setuputils tags: get,generic-python-lib,_package.setuptools +- tags: get,generic-sys-util,_vim-common extra_cache_tags_from_env: - env: CM_PYTHON_CACHE_TAGS From 6c6af3546ec8c38cfa026cdf1e48733b2c61ec44 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 23 Oct 2024 22:28:27 +0100 Subject: [PATCH 2/3] Fixed deps for loadgen build --- script/get-mlperf-inference-loadgen/_cm.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/script/get-mlperf-inference-loadgen/_cm.yaml b/script/get-mlperf-inference-loadgen/_cm.yaml index 49e3b186fe..3ce1f83992 100644 --- a/script/get-mlperf-inference-loadgen/_cm.yaml +++ b/script/get-mlperf-inference-loadgen/_cm.yaml @@ -76,7 +76,6 @@ deps: - pip-package - setuputils tags: get,generic-python-lib,_package.setuptools -- tags: get,generic-sys-util,_vim-common extra_cache_tags_from_env: - env: CM_PYTHON_CACHE_TAGS From a2821dd257695a9f8ba67c4ff96bcab89192701c Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 23 Oct 2024 23:30:20 +0100 Subject: [PATCH 3/3] Fix benchmark-program-mlperf command for power runs --- script/benchmark-program-mlperf/customize.py | 49 +++++++++++--------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/script/benchmark-program-mlperf/customize.py b/script/benchmark-program-mlperf/customize.py index 7d109051d9..4ca4f70df5 100644 --- a/script/benchmark-program-mlperf/customize.py +++ b/script/benchmark-program-mlperf/customize.py @@ -25,29 +25,34 @@ def postprocess(i): if os_info['platform'] != 'windows': # Construct the shell command with proper escaping - env['CM_MLPERF_RUN_CMD'] = ( - "CM_MLPERF_RUN_COUNT=$(cat ${CM_RUN_DIR}/count.txt); " - "echo ${CM_MLPERF_RUN_COUNT}; " - "CM_MLPERF_RUN_COUNT=$((CM_MLPERF_RUN_COUNT+1)); " - "echo ${CM_MLPERF_RUN_COUNT} > ${CM_RUN_DIR}/count.txt && " - "if [ ${CM_MLPERF_RUN_COUNT} -eq 1 ]; then " - "export CM_MLPERF_USER_CONF=${CM_MLPERF_RANGING_USER_CONF}; " - "else " - "export CM_MLPERF_USER_CONF=${CM_MLPERF_TESTING_USER_CONF}; " - "fi && " + env.get('CM_RUN_CMD', '').strip() - ) + env['CM_MLPERF_RUN_CMD'] = r""" +CM_MLPERF_RUN_COUNT=\$(cat \${CM_RUN_DIR}/count.txt); +echo \${CM_MLPERF_RUN_COUNT}; +CM_MLPERF_RUN_COUNT=\$((CM_MLPERF_RUN_COUNT+1)); +echo \${CM_MLPERF_RUN_COUNT} > \${CM_RUN_DIR}/count.txt && +if [ \${CM_MLPERF_RUN_COUNT} -eq 1 ]; then +export CM_MLPERF_USER_CONF="${CM_MLPERF_RANGING_USER_CONF}"; +else +export CM_MLPERF_USER_CONF="${CM_MLPERF_TESTING_USER_CONF}"; +fi && + """ + env.get('CM_RUN_CMD', '').strip() else: - env['CM_MLPERF_RUN_CMD'] = ( - "set /P CM_MLPERF_RUN_COUNT=<\"%CM_RUN_DIR%\\count.txt\" & " - "echo %CM_MLPERF_RUN_COUNT% & " - "set /A CM_MLPERF_RUN_COUNT=!CM_MLPERF_RUN_COUNT!+1 & " - "echo !CM_MLPERF_RUN_COUNT! > \"%CM_RUN_DIR%\\count.txt\" & " - "if !CM_MLPERF_RUN_COUNT! EQU 1 ( " - "set CM_MLPERF_USER_CONF=%CM_MLPERF_RANGING_USER_CONF% " - ") else ( " - "set CM_MLPERF_USER_CONF=%CM_MLPERF_TESTING_USER_CONF% " - ") & " + env.get('CM_RUN_CMD', '').strip() - ) + env['CM_MLPERF_RUN_CMD'] = r""" +:: Read the current count from the file +set /p CM_MLPERF_RUN_COUNT=<%CM_RUN_DIR%\count.txt +echo !CM_MLPERF_RUN_COUNT! + +:: Increment the count +set /a CM_MLPERF_RUN_COUNT=!CM_MLPERF_RUN_COUNT! + 1 +echo !CM_MLPERF_RUN_COUNT! > %CM_RUN_DIR%\count.txt + +:: Check the value and set the environment variable accordingly +if !CM_MLPERF_RUN_COUNT! EQU 1 ( + set CM_MLPERF_USER_CONF=%CM_MLPERF_RANGING_USER_CONF% +) else ( + set CM_MLPERF_USER_CONF=%CM_MLPERF_TESTING_USER_CONF% +) + """ + env.get('CM_RUN_CMD', '').strip() else: # Just use the existing CM_RUN_CMD if no ranging run is needed env['CM_MLPERF_RUN_CMD'] = env.get('CM_RUN_CMD', '').strip()