Skip to content

Commit 08ce312

Browse files
authored
Fixes for automatic mlperf inference submission upload (#186)
* Fix automatic submission via CLI (thanks to Pablo)
1 parent 3d260f2 commit 08ce312

File tree

6 files changed

+24
-10
lines changed

6 files changed

+24
-10
lines changed

script/generate-docs-for-all-scripts.cmd

Lines changed: 0 additions & 1 deletion
This file was deleted.

script/run-mlperf-inference-submission-checker/customize.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ def preprocess(i):
9696
def postprocess(i):
9797

9898
env = i['env']
99-
if env.get('MLC_TAR_SUBMISSION_DIR', ''):
100-
env['MLC_TAR_INPUT_DIR'] = env['MLC_MLPERF_INFERENCE_SUBMISSION_DIR']
10199

102100
x = env.get('MLPERF_INFERENCE_SUBMISSION_TAR_FILE', '')
103101
if x != '':

script/run-mlperf-inference-submission-checker/meta.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,20 @@ post_deps:
7272
names:
7373
- push-to-github
7474
tags: publish-results,github
75-
- enable_if_env:
75+
- enable_if_any_env:
7676
MLC_TAR_SUBMISSION_DIR:
7777
- 'yes'
78+
MLC_MLPERF_SUBMITTER_ID:
79+
- 'yes'
7880
tags: run,tar
81+
env:
82+
MLC_TAR_INPUT_DIR: <<<MLC_MLPERF_INFERENCE_SUBMISSION_DIR>>>
7983
- enable_if_env:
80-
MLC_SUBMITTER_ID:
84+
MLC_MLPERF_SUBMITTER_ID:
8185
- 'yes'
8286
tags: submit,mlperf,results,_inference
8387
env:
84-
MLC_MLPERF_SUBMISSION_FILE: <<<MLPERF_INFERENCE_SUBMISSION_TAR_FILE>>>
88+
MLC_MLPERF_SUBMISSION_FILE: <<<MLC_TAR_OUTFILE>>>
8589
tags:
8690
- run
8791
- mlc

script/submit-mlperf-results/customize.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@ def preprocess(i):
1515
benchmark = env['MLC_MLPERF_BENCHMARK']
1616
submitter_id = env['MLC_MLPERF_SUBMITTER_ID']
1717
file_path = env['MLC_MLPERF_SUBMISSION_FILE']
18-
19-
r = get_signed_url(server, benchmark, submitter_id, file_path)
18+
submitter_name = env.get('MLC_MLPERF_SUBMITTER', '')
19+
20+
r = get_signed_url(
21+
server,
22+
benchmark,
23+
submitter_id,
24+
submitter_name,
25+
file_path)
2026
if r['return'] > 0:
2127
return r
2228

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

3945

40-
def get_signed_url(server, benchmark, submitter_id, file_path):
46+
def get_signed_url(server, benchmark, submitter_id, submitter_name, file_path):
4147
# Define the URL
4248
url = f"{server}/index/url"
4349

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

7480
response_json = response.json()
75-
# print(response_json)
7681
# response = json.loads(response_json)
7782
try:
7883
signed_url = response_json['signed_url']
7984
submission_id = response_json['submission_id']
85+
submitter_name_from_id = response_json['submitter_name']
8086
except Exception as e:
8187
return {
8288
"return": 1, "error": f"An error occurred while processing the response: {e}"}
8389

90+
if submitter_name != '':
91+
if submitter_name != submitter_name_from_id:
92+
return {'return': 1, 'error': f"""Submitter name mismatch, given = {submitter_name}, name mapped to ID = {submitter_name_from_id}"""}
93+
8494
return {'return': 0, 'signed_url': signed_url,
8595
'submission_id': submission_id}
8696

script/tar-my-folder/customize.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def preprocess(i):
1818
input_dirname = os.path.basename(input_dir)
1919
if output_file == "":
2020
output_file = input_dirname + ".tar.gz"
21+
env['MLC_TAR_OUTFILE'] = output_file
2122
from pathlib import Path
2223
input_path = Path(input_dir)
2324
cd_dir = input_path.parent.absolute()

script/tar-my-folder/meta.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ input_mapping:
99
input_dir: MLC_TAR_INPUT_DIR
1010
outfile: MLC_TAR_OUTFILE
1111
output_dir: MLC_TAR_OUTPUT_DIR
12+
new_env_keys:
13+
- MLC_TAR_OUTFILE
1214
tags:
1315
- run
1416
- tar

0 commit comments

Comments
 (0)