Skip to content

Commit 3e96748

Browse files
authored
Fixes for mlperf inference code (#224)
* Fixes for mlperf inference code
1 parent a2f0887 commit 3e96748

File tree

6 files changed

+5
-28
lines changed

6 files changed

+5
-28
lines changed

script/app-mlperf-inference-ctuning-cpp-tflite/customize.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@ def preprocess(i):
8686
env['MLC_LINKER_LANG'] = 'CXX'
8787
env['MLC_RUN_DIR'] = os.getcwd()
8888

89-
if 'MLC_MLPERF_CONF' not in env:
90-
env['MLC_MLPERF_CONF'] = os.path.join(
91-
env['MLC_MLPERF_INFERENCE_SOURCE'], "mlperf.conf")
9289
if 'MLC_MLPERF_USER_CONF' not in env:
9390
env['MLC_MLPERF_USER_CONF'] = os.path.join(
9491
env['MLC_MLPERF_INFERENCE_CLASSIFICATION_AND_DETECTION_PATH'], "user.conf")

script/app-mlperf-inference-ctuning-cpp-tflite/src/classification.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ void TestSingleStream(Program *prg) {
336336
SystemUnderTestSingleStream sut(prg);
337337
QuerySampleLibrarySingleStream qsl(prg);
338338

339-
const std::string mlperf_conf_path = getenv_s("MLC_MLPERF_CONF");
340339
const std::string user_conf_path = getenv_s("MLC_MLPERF_USER_CONF");
341340
const std::string audit_conf_path =
342341
getenv_opt_s("MLC_MLPERF_INFERENCE_AUDIT_PATH", "");
@@ -347,7 +346,6 @@ void TestSingleStream(Program *prg) {
347346
const std::string scenario_string = getenv_s("MLC_MLPERF_LOADGEN_SCENARIO");
348347
const std::string mode_string = getenv_s("MLC_MLPERF_LOADGEN_MODE");
349348

350-
std::cout << "Path to mlperf.conf : " << mlperf_conf_path << std::endl;
351349
std::cout << "Path to user.conf : " << user_conf_path << std::endl;
352350
std::cout << "Model Name: " << model_name << std::endl;
353351
std::cout << "LoadGen Scenario: " << scenario_string << std::endl;
@@ -374,12 +372,6 @@ void TestSingleStream(Program *prg) {
374372
? mlperf::TestMode::FindPeakPerformance
375373
: mlperf::TestMode::SubmissionRun;
376374

377-
if (ts.FromConfig(mlperf_conf_path, model_name, scenario_string)) {
378-
std::cout << "Issue with mlperf.conf file at " << mlperf_conf_path
379-
<< std::endl;
380-
exit(1);
381-
}
382-
383375
if (ts.FromConfig(user_conf_path, model_name, scenario_string)) {
384376
std::cout << "Issue with user.conf file at " << user_conf_path << std::endl;
385377
exit(1);

script/app-mlperf-inference-mlcommons-cpp/customize.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ def preprocess(i):
9191
env['MLC_LINKER_LANG'] = 'CXX'
9292
env['MLC_RUN_DIR'] = os.getcwd()
9393

94-
if 'MLC_MLPERF_CONF' not in env:
95-
env['MLC_MLPERF_CONF'] = os.path.join(
96-
env['MLC_MLPERF_INFERENCE_SOURCE'], "mlperf.conf")
9794
if 'MLC_MLPERF_USER_CONF' not in env:
9895
env['MLC_MLPERF_USER_CONF'] = os.path.join(
9996
env['MLC_MLPERF_INFERENCE_CLASSIFICATION_AND_DETECTION_PATH'], "user.conf")

script/app-mlperf-inference-mlcommons-cpp/src/main.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class InputSettings {
2323

2424
public:
2525
InputSettings() {
26-
mlperf_conf_path = getenv("MLC_MLPERF_CONF", "../inference/mlperf.conf");
2726
user_conf_path =
2827
getenv("MLC_MLPERF_USER_CONF",
2928
"../inference/vision/classification_and_detection/user.conf");
@@ -49,7 +48,6 @@ class InputSettings {
4948
performance_sample_count =
5049
std::stol(getenv("MLC_MLPERF_LOADGEN_PERFORMANCE_SAMPLE_COUNT", "0"));
5150
batch_size = std::stol(getenv("MLC_MLPERF_LOADGEN_MAX_BATCHSIZE", "32"));
52-
std::cout << "MLPerf Conf path: " << mlperf_conf_path << std::endl;
5351
std::cout << "User Conf path: " << user_conf_path << std::endl;
5452
std::cout << "Dataset Preprocessed path: " << dataset_preprocessed_path
5553
<< std::endl;
@@ -62,7 +60,6 @@ class InputSettings {
6260
<< performance_sample_count << std::endl;
6361
}
6462

65-
std::string mlperf_conf_path;
6663
std::string user_conf_path;
6764
std::string audit_conf_path;
6865
std::string output_dir;
@@ -104,14 +101,6 @@ int main(int argc, const char *argv[]) {
104101
? mlperf::TestMode::FindPeakPerformance
105102
: mlperf::TestMode::SubmissionRun;
106103

107-
// read test settings from mlperf.conf and user.conf
108-
if (test_settings.FromConfig(input_settings.mlperf_conf_path,
109-
input_settings.model_name,
110-
input_settings.scenario_name)) {
111-
std::cerr << "Could not read mlperf.conf at "
112-
<< input_settings.mlperf_conf_path << std::endl;
113-
return 1;
114-
}
115104
if (test_settings.FromConfig(input_settings.user_conf_path,
116105
input_settings.model_name,
117106
input_settings.scenario_name)) {

script/app-mlperf-inference/customize.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ def postprocess(i):
311311
# if custom model name is not set, the official model name will be
312312
# mapped to itself
313313
official_model_name = model
314+
if "efficientnet" in official_model_name or "mobilenet" in official_model_name:
315+
official_model_name = "resnet"
314316
model_mapping = {model_full_name: official_model_name}
315317
with open("model_mapping.json", "w") as fp:
316318
json.dump(model_mapping, fp, indent=2)

script/run-mlperf-inference-mobilenet-models/meta.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ default_env:
99
MLC_MLPERF_RUN_INT8: 'yes'
1010
MLC_MLPERF_RUN_MOBILENETS: 'no'
1111
deps:
12-
- tags: get,sys-utils-cm
12+
- tags: get,sys-utils-mlc
1313
docker:
1414
input_mapping:
1515
imagenet_path: IMAGENET_PATH
@@ -21,8 +21,8 @@ docker:
2121
fake_run_deps: false
2222
mounts:
2323
- ${{ IMAGENET_PATH }}:${{ IMAGENET_PATH }}
24-
- ${{ RESULTS_DIR }}:/home/cmuser/mobilenet_results
25-
- ${{ SUBMISSION_DIR }}:/home/cmuser/inference_submission_3.1
24+
- ${{ RESULTS_DIR }}:${{ RESULTS_DIR }}
25+
- ${{ SUBMISSION_DIR }}:${{ SUBMISSION_DIR }}
2626
run: true
2727
input_mapping:
2828
find-performance: MLC_MLPERF_FIND_PERFORMANCE_MODE

0 commit comments

Comments
 (0)