From f1eb3d38ac0b795318dda73f8867c1f3af072831 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Thu, 25 Jan 2024 21:55:47 +0000 Subject: [PATCH] Fixes for MIL --- cm-mlops/script/app-mlperf-inference-cpp/src/main.cpp | 4 ++-- .../generate-mlperf-inference-user-conf/customize.py | 3 +-- .../run-all-mlperf-models/run-cpp-implementation.sh | 5 ++++- cm-mlops/script/run-mlperf-inference-app/customize.py | 11 +++++++++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/cm-mlops/script/app-mlperf-inference-cpp/src/main.cpp b/cm-mlops/script/app-mlperf-inference-cpp/src/main.cpp index 30026046f6..beb0b72f20 100644 --- a/cm-mlops/script/app-mlperf-inference-cpp/src/main.cpp +++ b/cm-mlops/script/app-mlperf-inference-cpp/src/main.cpp @@ -148,8 +148,8 @@ int main(int argc, const char *argv[]) { test_settings.performance_sample_count_override : input_settings.performance_sample_count; - if (performance_sample_count != 0) { - test_settings.performance_sample_count_override = performance_sample_count; + if (performance_sample_count != 0) {//Its changed from user.conf + //test_settings.performance_sample_count_override = performance_sample_count; } if (max_sample_count != 0) performance_sample_count = diff --git a/cm-mlops/script/generate-mlperf-inference-user-conf/customize.py b/cm-mlops/script/generate-mlperf-inference-user-conf/customize.py index b002c3a4ce..40891f59cf 100644 --- a/cm-mlops/script/generate-mlperf-inference-user-conf/customize.py +++ b/cm-mlops/script/generate-mlperf-inference-user-conf/customize.py @@ -280,10 +280,9 @@ def preprocess(i): ranging_user_conf_file.write_text(ranging_user_conf) - if env.get('CM_MLPERF_LOADGEN_QUERY_COUNT','') == '' and query_count and (mode != "accuracy" or env['CM_MLPERF_RUN_STYLE'] != "valid"): + if (env.get('CM_MLPERF_LOADGEN_QUERY_COUNT','') == '') and query_count and ((mode != "accuracy") or (env['CM_MLPERF_RUN_STYLE'] != "valid")): env['CM_MLPERF_LOADGEN_QUERY_COUNT'] = query_count - if not run_exists or rerun: print("Output Dir: '" + OUTPUT_DIR + "'") diff --git a/cm-mlops/script/run-all-mlperf-models/run-cpp-implementation.sh b/cm-mlops/script/run-all-mlperf-models/run-cpp-implementation.sh index 89e9b170b6..694edf6d69 100644 --- a/cm-mlops/script/run-all-mlperf-models/run-cpp-implementation.sh +++ b/cm-mlops/script/run-all-mlperf-models/run-cpp-implementation.sh @@ -28,11 +28,14 @@ division="closed" POWER=" --power=yes --adr.mlperf-power-client.power_server=192.168.0.15 --adr.mlperf-power-client.port=4950 " POWER="" + +run "cm run script --tags=set,system,performance,mode" + #cpp run "cm run script --tags=generate-run-cmds,inference,_find-performance \ --model=resnet50 --implementation=cpp --device=cpu --backend=onnxruntime \ --adr.compiler.tags=gcc \ ---category=edge --division=open --scenario=Offline --quiet --test_query_count=100" +--category=edge --division=open --scenario=Offline --quiet --test_query_count=2000 " run "cm run script --tags=generate-run-cmds,inference,_find-performance \ --model=retinanet --implementation=cpp --device=cpu --backend=onnxruntime \ diff --git a/cm-mlops/script/run-mlperf-inference-app/customize.py b/cm-mlops/script/run-mlperf-inference-app/customize.py index 545df50f98..fe26967e47 100644 --- a/cm-mlops/script/run-mlperf-inference-app/customize.py +++ b/cm-mlops/script/run-mlperf-inference-app/customize.py @@ -136,6 +136,7 @@ def preprocess(i): print ('=========================================================') + local_keys = [ 'CM_MLPERF_SKIP_RUN', 'CM_MLPERF_LOADGEN_QUERY_COUNT' ] for scenario in env['CM_MLPERF_LOADGEN_SCENARIOS']: scenario_tags = tags + ",_"+scenario.lower() env['CM_MLPERF_LOADGEN_SCENARIO'] = scenario @@ -174,6 +175,10 @@ def preprocess(i): if 'CM_MLPERF_DEVICE' in r['new_env']: env['CM_MLPERF_DEVICE'] = r['new_env']['CM_MLPERF_DEVICE'] + for key in local_keys: + if env.get(key, '') != '': + del(env[key]) + if env.get("CM_MLPERF_LOADGEN_COMPLIANCE", "") == "yes": for test in test_list: env['CM_MLPERF_LOADGEN_COMPLIANCE_TEST'] = test @@ -183,8 +188,10 @@ def preprocess(i): copy.deepcopy(add_deps_recursive), 'adr': copy.deepcopy(adr), 'ad': ad, 'v': verbose, 'print_env': print_env, 'print_deps': print_deps}) if r['return'] > 0: return r - if env.get('CM_MLPERF_SKIP_RUN', '') != '': - del(env['CM_MLPERF_SKIP_RUN']) + + for key in local_keys: + if env.get(key, '') != '': + del(env[key]) return {'return':0}