Skip to content

Fixes for automatic mlperf inference submission upload #186

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 3 commits into from
Feb 5, 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
1 change: 0 additions & 1 deletion script/generate-docs-for-all-scripts.cmd

This file was deleted.

2 changes: 0 additions & 2 deletions script/run-mlperf-inference-submission-checker/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ def preprocess(i):
def postprocess(i):

env = i['env']
if env.get('MLC_TAR_SUBMISSION_DIR', ''):
env['MLC_TAR_INPUT_DIR'] = env['MLC_MLPERF_INFERENCE_SUBMISSION_DIR']

x = env.get('MLPERF_INFERENCE_SUBMISSION_TAR_FILE', '')
if x != '':
Expand Down
10 changes: 7 additions & 3 deletions script/run-mlperf-inference-submission-checker/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,20 @@ post_deps:
names:
- push-to-github
tags: publish-results,github
- enable_if_env:
- enable_if_any_env:
MLC_TAR_SUBMISSION_DIR:
- 'yes'
MLC_MLPERF_SUBMITTER_ID:
- 'yes'
tags: run,tar
env:
MLC_TAR_INPUT_DIR: <<<MLC_MLPERF_INFERENCE_SUBMISSION_DIR>>>
- enable_if_env:
MLC_SUBMITTER_ID:
MLC_MLPERF_SUBMITTER_ID:
- 'yes'
tags: submit,mlperf,results,_inference
env:
MLC_MLPERF_SUBMISSION_FILE: <<<MLPERF_INFERENCE_SUBMISSION_TAR_FILE>>>
MLC_MLPERF_SUBMISSION_FILE: <<<MLC_TAR_OUTFILE>>>
tags:
- run
- mlc
Expand Down
18 changes: 14 additions & 4 deletions script/submit-mlperf-results/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ def preprocess(i):
benchmark = env['MLC_MLPERF_BENCHMARK']
submitter_id = env['MLC_MLPERF_SUBMITTER_ID']
file_path = env['MLC_MLPERF_SUBMISSION_FILE']

r = get_signed_url(server, benchmark, submitter_id, file_path)
submitter_name = env.get('MLC_MLPERF_SUBMITTER', '')

r = get_signed_url(
server,
benchmark,
submitter_id,
submitter_name,
file_path)
if r['return'] > 0:
return r

Expand All @@ -37,7 +43,7 @@ def preprocess(i):
return {'return': 0}


def get_signed_url(server, benchmark, submitter_id, file_path):
def get_signed_url(server, benchmark, submitter_id, submitter_name, file_path):
# Define the URL
url = f"{server}/index/url"

Expand Down Expand Up @@ -72,15 +78,19 @@ def get_signed_url(server, benchmark, submitter_id, file_path):
"error": f"An error occurred in connecting to the server: {e}"}

response_json = response.json()
# print(response_json)
# response = json.loads(response_json)
try:
signed_url = response_json['signed_url']
submission_id = response_json['submission_id']
submitter_name_from_id = response_json['submitter_name']
except Exception as e:
return {
"return": 1, "error": f"An error occurred while processing the response: {e}"}

if submitter_name != '':
if submitter_name != submitter_name_from_id:
return {'return': 1, 'error': f"""Submitter name mismatch, given = {submitter_name}, name mapped to ID = {submitter_name_from_id}"""}

return {'return': 0, 'signed_url': signed_url,
'submission_id': submission_id}

Expand Down
1 change: 1 addition & 0 deletions script/tar-my-folder/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def preprocess(i):
input_dirname = os.path.basename(input_dir)
if output_file == "":
output_file = input_dirname + ".tar.gz"
env['MLC_TAR_OUTFILE'] = output_file
from pathlib import Path
input_path = Path(input_dir)
cd_dir = input_path.parent.absolute()
Expand Down
2 changes: 2 additions & 0 deletions script/tar-my-folder/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ input_mapping:
input_dir: MLC_TAR_INPUT_DIR
outfile: MLC_TAR_OUTFILE
output_dir: MLC_TAR_OUTPUT_DIR
new_env_keys:
- MLC_TAR_OUTFILE
tags:
- run
- tar
Expand Down
Loading