Skip to content

Cleanup for run-mobilenet script #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/test-scc24-sdxl.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: MLPerf inference SDXL (SCC)


on:
schedule:
- cron: "34 19 * * *"
- cron: "34 19 1 * *"

jobs:
build_reference:
Expand Down
49 changes: 23 additions & 26 deletions script/run-mlperf-inference-mobilenet-models/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import os
import sys
from utils import *
import mlc
import importlib


def preprocess(i):
Expand All @@ -17,7 +19,9 @@ def preprocess(i):
adr = i['input'].get('adr')

automation = i['automation']
mlc = i['automation'].action_object
# mlc = i['automation'].action_object
# cache_action = i['automation'].cache_action
cache_action = mlc

quiet = (env.get('MLC_QUIET', False) == 'yes')
verbose = (env.get('MLC_VERBOSE', False) == 'yes')
Expand Down Expand Up @@ -61,7 +65,7 @@ def preprocess(i):
models['mobilenet']['v3'] = models_all['mobilenet']['v3']
elif is_true(env.get('MLC_MLPERF_RUN_MOBILENETS', '')):
models['mobilenet'] = models_all['mobilenet']
elif is_true(env.get('MLC_MLPERF_RUN_EFFICIENTNETS', '')):
if is_true(env.get('MLC_MLPERF_RUN_EFFICIENTNETS', '')):
models['efficientnet'] = models_all['efficientnet']

variation_strings = {}
Expand Down Expand Up @@ -107,17 +111,17 @@ def preprocess(i):
execution_mode = "test"

precisions = []
if env.get('MLC_MLPERF_RUN_FP32', '') == "yes":
if is_true(env.get('MLC_MLPERF_RUN_FP32', '')):
precisions.append("fp32")
if env.get('MLC_MLPERF_RUN_INT8', '') == "yes":
if is_true(env.get('MLC_MLPERF_RUN_INT8', '')):
precisions.append("uint8")

implementation_tags = []
if env.get('MLC_MLPERF_USE_ARMNN_LIBRARY', '') == "yes":
if is_true(env.get('MLC_MLPERF_USE_ARMNN_LIBRARY', '')):
implementation_tags.append("_armnn")
if env.get('MLC_MLPERF_TFLITE_ARMNN_NEON', '') == "yes":
if is_true(env.get('MLC_MLPERF_TFLITE_ARMNN_NEON', '')):
implementation_tags.append("_use-neon")
if env.get('MLC_MLPERF_TFLITE_ARMNN_OPENCL', '') == "yes":
if is_true(env.get('MLC_MLPERF_TFLITE_ARMNN_OPENCL', '')):
implementation_tags.append("_use-opencl")
implementation_tags_string = ",".join(implementation_tags)

Expand Down Expand Up @@ -185,34 +189,27 @@ def preprocess(i):
if is_true(env.get('MLC_MLPERF_POWER', '')):
mlc_input['power'] = '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 is_true(env.get('MLC_MLPERF_PERFORMANCE_MODE', '')):
mlc_input['mode'] = 'performance'

print(mlc_input)
r = mlc.access(mlc_input)
if r['return'] > 0:
return r

if env.get('MLC_TEST_ONE_RUN', '') == "yes":
return {'return': 0}
print(mlc_input)
r = mlc.access(mlc_input)
if r['return'] > 0:
return r
importlib.reload(mlc.action)

if is_true(env.get('MLC_MINIMIZE_DISK_SPACE', '')):
r = mlc.access(clean_input)
r = cache_action.access(clean_input)
if r['return'] > 0:
print(r)
# return r

r = mlc.access(clean_input)
if is_true(env.get('MLC_TEST_ONE_RUN', '')):
return {'return': 0}

r = cache_action.access(clean_input)
if r['return'] > 0:
print(r)
# return r
else:
importlib.reload(mlc.action)
return {'return': 0}


Expand Down
Loading