Skip to content

Create dummy measurements.json file if not present #216

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

Merged
merged 8 commits into from
Feb 14, 2025
Merged
Changes from 4 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
14 changes: 11 additions & 3 deletions script/generate-mlperf-inference-submission/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,17 @@ def generate_submission(env, state, inp, submission_division):
shutil.copy(measurements_json_path, destination)

else:
if mode.lower() == "performance":
return {
"return": 1, "error": f"measurements.json missing in both paths: {measurements_json_path} and {os.path.join(result_scenario_path, 'user.conf')}"}
print(
f"Warning: measurements.json file not present, creating a dummy measurements.json in path {measurements_json_path}")
dummy_measurements_data = {
"input_data_types": env['MLC_ML_MODEL_INPUTS_DATA_TYPE'] if env.get('MLC_ML_MODEL_INPUTS_DATA_TYPE') else None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should change None to 'TBD' so that submission checker doesnt complain.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I do remember getting a similar error. Fixed in latest commit

"retraining": env['MLC_ML_MODEL_RETRAINING'] if env.get('MLC_ML_MODEL_RETRAINING') else None,
"starting_weights_filename": env['MLC_ML_MODEL_STARTING_WEIGHTS_FILENAME'] if env.get('MLC_ML_MODEL_STARTING_WEIGHTS_FILENAME') else None,
"weight_data_types": env['MLC_ML_MODEL_WEIGHTS_DATA_TYPE'] if env.get('MLC_ML_MODEL_WEIGHTS_DATA_TYPE') else None,
"weight_transformations": env['MLC_ML_MODEL_WEIGHT_TRANSFORMATIONS'] if env.get('MLC_ML_MODEL_WEIGHT_TRANSFORMATIONS') else None
}
with open(measurements_json_path, 'w') as json_file:
json.dump(data, json_file, indent=4)

files = []
readme = False
Expand Down
Loading