Skip to content
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

Fixes #184, issue with --extra_script_cmd #185

Merged
merged 3 commits into from
Feb 4, 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
18 changes: 2 additions & 16 deletions automation/script/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,31 +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', '')
# Caching selections to avoid asking users again
Expand Down
2 changes: 1 addition & 1 deletion script/app-mlperf-inference/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading