Skip to content

Commit 231a219

Browse files
authored
Cleanup for run-mobilenet script (#272)
1 parent b964b0b commit 231a219

File tree

2 files changed

+25
-27
lines changed

2 files changed

+25
-27
lines changed

.github/workflows/test-scc24-sdxl.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: MLPerf inference SDXL (SCC)
22

3+
34
on:
45
schedule:
5-
- cron: "34 19 * * *"
6+
- cron: "34 19 1 * *"
67

78
jobs:
89
build_reference:

script/run-mlperf-inference-mobilenet-models/customize.py

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import os
33
import sys
44
from utils import *
5+
import mlc
6+
import importlib
57

68

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

1921
automation = i['automation']
20-
mlc = i['automation'].action_object
22+
# mlc = i['automation'].action_object
23+
# cache_action = i['automation'].cache_action
24+
cache_action = mlc
2125

2226
quiet = (env.get('MLC_QUIET', False) == 'yes')
2327
verbose = (env.get('MLC_VERBOSE', False) == 'yes')
@@ -61,7 +65,7 @@ def preprocess(i):
6165
models['mobilenet']['v3'] = models_all['mobilenet']['v3']
6266
elif is_true(env.get('MLC_MLPERF_RUN_MOBILENETS', '')):
6367
models['mobilenet'] = models_all['mobilenet']
64-
elif is_true(env.get('MLC_MLPERF_RUN_EFFICIENTNETS', '')):
68+
if is_true(env.get('MLC_MLPERF_RUN_EFFICIENTNETS', '')):
6569
models['efficientnet'] = models_all['efficientnet']
6670

6771
variation_strings = {}
@@ -107,17 +111,17 @@ def preprocess(i):
107111
execution_mode = "test"
108112

109113
precisions = []
110-
if env.get('MLC_MLPERF_RUN_FP32', '') == "yes":
114+
if is_true(env.get('MLC_MLPERF_RUN_FP32', '')):
111115
precisions.append("fp32")
112-
if env.get('MLC_MLPERF_RUN_INT8', '') == "yes":
116+
if is_true(env.get('MLC_MLPERF_RUN_INT8', '')):
113117
precisions.append("uint8")
114118

115119
implementation_tags = []
116-
if env.get('MLC_MLPERF_USE_ARMNN_LIBRARY', '') == "yes":
120+
if is_true(env.get('MLC_MLPERF_USE_ARMNN_LIBRARY', '')):
117121
implementation_tags.append("_armnn")
118-
if env.get('MLC_MLPERF_TFLITE_ARMNN_NEON', '') == "yes":
122+
if is_true(env.get('MLC_MLPERF_TFLITE_ARMNN_NEON', '')):
119123
implementation_tags.append("_use-neon")
120-
if env.get('MLC_MLPERF_TFLITE_ARMNN_OPENCL', '') == "yes":
124+
if is_true(env.get('MLC_MLPERF_TFLITE_ARMNN_OPENCL', '')):
121125
implementation_tags.append("_use-opencl")
122126
implementation_tags_string = ",".join(implementation_tags)
123127

@@ -185,34 +189,27 @@ def preprocess(i):
185189
if is_true(env.get('MLC_MLPERF_POWER', '')):
186190
mlc_input['power'] = 'yes'
187191

188-
if is_true(env.get('MLC_MLPERF_ACCURACY_MODE', '')):
189-
mlc_input['mode'] = 'accuracy'
190-
print(mlc_input)
191-
r = mlc.access(mlc_input)
192-
if r['return'] > 0:
193-
return r
194-
195-
if is_true(env.get('MLC_MLPERF_PERFORMANCE_MODE', '')):
196-
mlc_input['mode'] = 'performance'
197-
198-
print(mlc_input)
199-
r = mlc.access(mlc_input)
200-
if r['return'] > 0:
201-
return r
202-
203-
if env.get('MLC_TEST_ONE_RUN', '') == "yes":
204-
return {'return': 0}
192+
print(mlc_input)
193+
r = mlc.access(mlc_input)
194+
if r['return'] > 0:
195+
return r
196+
importlib.reload(mlc.action)
205197

206198
if is_true(env.get('MLC_MINIMIZE_DISK_SPACE', '')):
207-
r = mlc.access(clean_input)
199+
r = cache_action.access(clean_input)
208200
if r['return'] > 0:
209201
print(r)
210202
# return r
211203

212-
r = mlc.access(clean_input)
204+
if is_true(env.get('MLC_TEST_ONE_RUN', '')):
205+
return {'return': 0}
206+
207+
r = cache_action.access(clean_input)
213208
if r['return'] > 0:
214209
print(r)
215210
# return r
211+
else:
212+
importlib.reload(mlc.action)
216213
return {'return': 0}
217214

218215

0 commit comments

Comments
 (0)