From b86746e00362bd108e7675e40ad7349b3a0cec27 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 5 Feb 2025 01:16:55 +0530 Subject: [PATCH 1/2] Fixes #184, issue with --extra_script_cmd --- automation/script/module.py | 17 ++--------------- script/app-mlperf-inference/customize.py | 4 ++-- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/automation/script/module.py b/automation/script/module.py index 8e7556eb4..79fb1efb9 100644 --- a/automation/script/module.py +++ b/automation/script/module.py @@ -273,30 +273,17 @@ def _run(self, i): # Useful to set up default flags such as the name of virtual enviroment extra_cli = os.environ.get('MLC_SCRIPT_EXTRA_CMD', '').strip() if extra_cli != '': - from cmind import cli - r = cli.parse(extra_cli) + r = convert_args_to_dictionary(extra_cli) if r['return'] > 0: return r - mlc_input = r['mlc_input'] + mlc_input = r['args_dict'] utils.merge_dicts({'dict1': i, 'dict2': mlc_input, 'append_lists': True, 'append_unique': True}) - # Check if has extra tags as a second artifact - # Example: cmr . "_python _tiny" - - parsed_artifacts = i.get('parsed_artifacts', []) - if len(parsed_artifacts) > 0: - extra_tags = parsed_artifacts[0][0][0] - if ' ' in extra_tags or ',' in extra_tags: - # Add tags - x = i.get('tags', '') - if x != '': - x += ',' - i['tags'] = x + extra_tags.replace(' ', ',') # Recursion spaces needed to format log and print recursion_spaces = i.get('recursion_spaces', '') diff --git a/script/app-mlperf-inference/customize.py b/script/app-mlperf-inference/customize.py index f5e3619d0..7660d9759 100644 --- a/script/app-mlperf-inference/customize.py +++ b/script/app-mlperf-inference/customize.py @@ -197,7 +197,7 @@ def postprocess(i): ][model][scenario] = {} # if env.get("MLC_MLPERF_FIND_PERFORMANCE_MODE", '') == "yes" and mode == - # "performance" and scenario != "Server": + # "performance" and scenario != "Server": if mode == "performance" and scenario != "Server": os.chdir(output_dir) if not os.path.exists("mlperf_log_summary.txt"): @@ -239,7 +239,7 @@ def postprocess(i): sut_config[model_full_name][scenario][metric] = value print( - f"SUT: {sut_name}, model: {model_full_name}, scenario: {scenario}, {metric} updated as {value}") + f"SUT: {sut_name}, model: {model_full_name}, scenario: {scenario}, {metric} (mean value) updated as {value}") print(f"New config stored in {sut_config_path}") with open(sut_config_path, "w") as f: yaml.dump(sut_config, f) From 0d92f8f2bda8ffb3caf629133e0e7ad4bfc34074 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 4 Feb 2025 19:47:19 +0000 Subject: [PATCH 2/2] [Automated Commit] Format Codebase --- automation/script/module.py | 1 - script/app-mlperf-inference/customize.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/automation/script/module.py b/automation/script/module.py index 79fb1efb9..ac531da64 100644 --- a/automation/script/module.py +++ b/automation/script/module.py @@ -284,7 +284,6 @@ def _run(self, i): 'append_lists': True, 'append_unique': True}) - # Recursion spaces needed to format log and print recursion_spaces = i.get('recursion_spaces', '') # Caching selections to avoid asking users again diff --git a/script/app-mlperf-inference/customize.py b/script/app-mlperf-inference/customize.py index 7660d9759..4248fe894 100644 --- a/script/app-mlperf-inference/customize.py +++ b/script/app-mlperf-inference/customize.py @@ -197,7 +197,7 @@ def postprocess(i): ][model][scenario] = {} # if env.get("MLC_MLPERF_FIND_PERFORMANCE_MODE", '') == "yes" and mode == - # "performance" and scenario != "Server": + # "performance" and scenario != "Server": if mode == "performance" and scenario != "Server": os.chdir(output_dir) if not os.path.exists("mlperf_log_summary.txt"):