From ef7723e64d9104f5ed2e6b3f72a95b4442ddfb9d Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Sun, 23 Feb 2025 21:53:22 +0000 Subject: [PATCH 1/3] Make low disk usage the default in mobilenet run --- .../customize.py | 28 +++++++++---------- .../meta.yaml | 1 + 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/script/run-mlperf-inference-mobilenet-models/customize.py b/script/run-mlperf-inference-mobilenet-models/customize.py index 0d50b0c37..2588aca8e 100644 --- a/script/run-mlperf-inference-mobilenet-models/customize.py +++ b/script/run-mlperf-inference-mobilenet-models/customize.py @@ -50,18 +50,18 @@ def preprocess(i): } models = {} - if env.get('MLC_MLPERF_RUN_MOBILENET_V1', '') == "yes": + if is_true(env.get('MLC_MLPERF_RUN_MOBILENET_V1', '')): models['mobilenet'] = {} models['mobilenet']['v1'] = models_all['mobilenet']['v1'] - elif env.get('MLC_MLPERF_RUN_MOBILENET_V2', '') == "yes": + elif is_true(env.get('MLC_MLPERF_RUN_MOBILENET_V2', '')): models['mobilenet'] = {} models['mobilenet']['v2'] = models_all['mobilenet']['v2'] - elif env.get('MLC_MLPERF_RUN_MOBILENET_V3', '') == "yes": + elif is_true(env.get('MLC_MLPERF_RUN_MOBILENET_V3', '')): models['mobilenet'] = {} models['mobilenet']['v3'] = models_all['mobilenet']['v3'] - elif env.get('MLC_MLPERF_RUN_MOBILENETS', '') == "yes": + elif is_true(env.get('MLC_MLPERF_RUN_MOBILENETS', '')): models['mobilenet'] = models_all['mobilenet'] - elif env.get('MLC_MLPERF_RUN_EFFICIENTNETS', '') == "yes": + elif is_true(env.get('MLC_MLPERF_RUN_EFFICIENTNETS', '')): models['efficientnet'] = models_all['efficientnet'] variation_strings = {} @@ -90,16 +90,16 @@ def preprocess(i): variation_list.append("_" + k3) variation_strings[t1].append(",".join(variation_list)) - if env.get('MLC_MLPERF_SUBMISSION_MODE', '') == "yes": + if is_true(env.get('MLC_MLPERF_SUBMISSION_MODE', '')): var = "_submission" execution_mode = "valid" - elif env.get('MLC_MLPERF_ACCURACY_MODE', '') == "yes" and env.get('MLC_MLPERF_PERFORMANCE_MODE', '') == "yes": + elif is_true(env.get('MLC_MLPERF_ACCURACY_MODE', '')) and is_true(env.get('MLC_MLPERF_PERFORMANCE_MODE', '')): var = "_full,_performance-and-accuracy" execution_mode = "valid" - elif env.get('MLC_MLPERF_ACCURACY_MODE', '') == "yes": + elif is_true(env.get('MLC_MLPERF_ACCURACY_MODE', '')): var = "_full,_accuracy-only" execution_mode = "valid" - elif env.get('MLC_MLPERF_PERFORMANCE_MODE', '') == "yes": + elif is_true(env.get('MLC_MLPERF_PERFORMANCE_MODE', '')): var = "_full,_performance-only" execution_mode = "valid" else: @@ -178,21 +178,21 @@ def preprocess(i): if env.get('MLC_MLPERF_INFERENCE_SUBMISSION_DIR', '') != '': mlc_input['submission_dir'] = env['MLC_MLPERF_INFERENCE_SUBMISSION_DIR'] - if env.get('MLC_MLPERF_FIND_PERFORMANCE_MODE', '') == "yes" and env.get( - 'MLC_MLPERF_NO_RERUN', '') != 'yes': + if is_true(env.get('MLC_MLPERF_FIND_PERFORMANCE_MODE', '')) and not is_true(env.get( + 'MLC_MLPERF_NO_RERUN', '')): mlc_input['rerun'] = True - if env.get('MLC_MLPERF_POWER', '') == "yes": + if is_true(env.get('MLC_MLPERF_POWER', '')): mlc_input['power'] = 'yes' - if env.get('MLC_MLPERF_ACCURACY_MODE', '') == "yes": + if is_true(env.get('MLC_MLPERF_ACCURACY_MODE', '')): mlc_input['mode'] = 'accuracy' print(mlc_input) r = mlc.access(mlc_input) if r['return'] > 0: return r - if env.get('MLC_MLPERF_PERFORMANCE_MODE', '') == "yes": + if is_true(env.get('MLC_MLPERF_PERFORMANCE_MODE', '')): mlc_input['mode'] = 'performance' print(mlc_input) diff --git a/script/run-mlperf-inference-mobilenet-models/meta.yaml b/script/run-mlperf-inference-mobilenet-models/meta.yaml index e2c9526fb..f45ab7c64 100644 --- a/script/run-mlperf-inference-mobilenet-models/meta.yaml +++ b/script/run-mlperf-inference-mobilenet-models/meta.yaml @@ -9,6 +9,7 @@ default_env: MLC_MLPERF_RUN_INT8: 'yes' MLC_MLPERF_RUN_MOBILENETS: 'no' MLC_USE_DATASET_FROM_HOST: 'yes' + MLC_MINIMIZE_DISK_SPACE: 'yes' deps: - tags: get,sys-utils-mlc docker: From d20052351fd42a54e772a0c91d622e9f9c54135b Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Mon, 24 Feb 2025 00:41:22 +0000 Subject: [PATCH 2/3] Fix docker user for mobilenet --- script/run-mlperf-inference-mobilenet-models/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/script/run-mlperf-inference-mobilenet-models/meta.yaml b/script/run-mlperf-inference-mobilenet-models/meta.yaml index f45ab7c64..a6a42760a 100644 --- a/script/run-mlperf-inference-mobilenet-models/meta.yaml +++ b/script/run-mlperf-inference-mobilenet-models/meta.yaml @@ -45,6 +45,7 @@ docker: - "${{ MLC_MLPERF_INFERENCE_SUBMISSION_DIR }}:${{ MLC_MLPERF_INFERENCE_SUBMISSION_DIR }}" run: true interactive: true + user: mlcuser mlc_repo: mlcommons@mlperf-automations mlc_repo_branch: dev real_run: False From 828415392b4bd0ccaea54a041990ab875b341463 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Mon, 24 Feb 2025 14:56:41 +0530 Subject: [PATCH 3/3] Fix mobilenet run script --- .../run-mobilenet-models.sh | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/script/run-all-mlperf-models/run-mobilenet-models.sh b/script/run-all-mlperf-models/run-mobilenet-models.sh index a268c49b1..9ad2bc7cd 100644 --- a/script/run-all-mlperf-models/run-mobilenet-models.sh +++ b/script/run-all-mlperf-models/run-mobilenet-models.sh @@ -32,24 +32,20 @@ extra_tags="" #Add your run commands here... # run "$MLC_RUN_CMD" -run "mlcr run,mobilenet-models,_tflite,_accuracy-only$extra_tags \ +run "mlcr run,mobilenet-models,_tflite$extra_tags \ --adr.compiler.tags=gcc \ ${extra_option} " -run "mlcr run,mobilenet-models,_tflite,_performance-only$extra_tags \ -${POWER} \ +run "mlcr run,mobilenet-models,_tflite,_armnn,_neon$extra_tags \ --adr.compiler.tags=gcc \ -${extra_option}" - +${extra_option} " -run "mlcr run,mobilenet-models,_tflite,_armnn,_neon,_accuracy-only$extra_tags \ +extra_option=" --adr.mlperf-inference-implementation.compressed_dataset=on" +run "mlcr run,mobilenet-models,_tflite$extra_tags \ --adr.compiler.tags=gcc \ ${extra_option} " -run "mlcr run,mobilenet-models,_tflite,_armnn,_neon,_performance-only$extra_tags \ -${POWER} \ -${extra_option} \ ---adr.compiler.tags=gcc" - - +run "mlcr run,mobilenet-models,_tflite,_armnn,_neon$extra_tags \ +--adr.compiler.tags=gcc \ +${extra_option} "