Skip to content

Commit 7651400

Browse files
pgmpablo157321github-actions[bot]anandhu-eng
authored
Submission checker modularization (mlcommons#2397)
* First sketch of submission checker * Add initial loader loop * Quick fixes for loader class * Add performance checks new submission checker * Add accuracy checks to submission checker * Add next batch of checks * Add compliance check * Add power check * Add additional bandwidth check * Add results to submission checker * Add power metric to output summary * Log results summary to terminal * Update summary + Add skipped compliance test * Add useful functions for automation to submission checker utils * [Automated Commit] Format Codebase * Add local path to system path * Add missing arguments * Add v6.0 constants to new submission checker * [Automated Commit] Format Codebase * Previous submission checker file renamed * test commit - gh action * String formatting to support contents with space (mlcommons#2428) * String formatting to support contents with space * test commit * [Automated Commit] Format Codebase * Test commit * [Automated Commit] Format Codebase * Update RESULTS_FIELD_NEW --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * [Automated Commit] Format Codebase * Update checker README * Update test-submission-generation.yml * Test commit - github actions * Update test-submission-generation.yml * Ensure main() exit status is returned to shell (mlcommons#2432) * Add support for endpoints logs * [Automated Commit] Format Codebase * Quick fix: init messages correctly * v5.1 and lower compatibility: skip dataset test * Format files * Add src check to submission checker * Format loader file * Remove unused files in submission checker * Autopep8 format new submission checker * [Automated Commit] Format Codebase * Fix Bug: do not skip measurements checks * Bug Fix: power checker bad formatting * [Automated Commit] Format Codebase * Bug Fix: move code dir to src dir * Delete more unused code * Add docstring to new submission checker * Remove custom branch pointer * fix typo * Update v6.0 seeds --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: ANANDHU S <71482562+anandhu-eng@users.noreply.github.com> Co-authored-by: anandhu-eng <anandhusooraj011@gmail.com>
1 parent 9142ef0 commit 7651400

29 files changed

+5996
-21
lines changed

.github/workflows/test-resnet50.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ jobs:
3535
python-version: ${{ matrix.python-version }}
3636
- name: Install dependencies
3737
run: |
38-
python3 -m pip install mlcflow
39-
mlc pull repo mlcommons@mlperf-automations --branch=dev
40-
#python3 -m pip install mlc-scripts
38+
python3 -m pip install mlc-scripts
4139
- name: Test Resnet50 and end to end submission generation
4240
run: |
43-
mlcr run,mlperf,inference,generate-run-cmds,_submission,_short --quiet --submitter="MLCommons" --hw_name=default --model=resnet50 --implementation=reference --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --test_query_count=500 --adr.compiler.tags=gcc --adr.inference-src.tags=_branch.${{ github.event.pull_request.head.ref }},_repo.${{ github.event.pull_request.head.repo.html_url }} --adr.inference-src.version=custom --adr.inference-src-loadgen.tags=_branch.${{ github.event.pull_request.head.ref }},_repo.${{ github.event.pull_request.head.repo.html_url }} --adr.inference-src-loadgen.version=custom --adr.loadgen.version=custom ${{ matrix.loadgen-flag }}
41+
mlcr run,mlperf,inference,generate-run-cmds,_submission,_short,_r6.0-dev --quiet --submitter="MLCommons" --hw_name=default --model=resnet50 --implementation=reference --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --test_query_count=500 --adr.compiler.tags=gcc --adr.inference-src.tags=_branch.${{ github.event.pull_request.head.ref }},_repo.${{ github.event.pull_request.head.repo.html_url }} --adr.inference-src.version=custom --adr.inference-src-loadgen.tags=_branch.${{ github.event.pull_request.head.ref }},_repo.${{ github.event.pull_request.head.repo.html_url }} --adr.inference-src-loadgen.version=custom --adr.loadgen.version=custom ${{ matrix.loadgen-flag }}

.github/workflows/test-retinanet.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ jobs:
3333
python-version: ${{ matrix.python-version }}
3434
- name: Install dependencies
3535
run: |
36-
python3 -m pip install mlcflow
37-
mlc pull repo mlcommons@mlperf-automations --branch=dev
38-
#python3 -m pip install mlc-scripts
36+
python3 -m pip install mlc-scripts
3937
- name: Test Retinanet and end to end submission generation
4038
run: |
41-
mlcr run,mlperf,inference,generate-run-cmds,_submission,_short --quiet --submitter="MLCommons" --hw_name=default --model=retinanet --implementation=reference --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --test_query_count=10 --adr.compiler.tags=gcc --adr.inference-src.version=custom --adr.inference-src.tags=_repo.${{ github.event.pull_request.head.repo.html_url }},_branch.${{ github.event.pull_request.head.ref }} --adr.inference-src-loadgen.tags=_branch.${{ github.event.pull_request.head.ref }},_repo.${{ github.event.pull_request.head.repo.html_url }} --adr.inference-src-loadgen.version=custom --adr.loadgen.version=custom
39+
mlcr run,mlperf,inference,generate-run-cmds,_submission,_short,_r6.0-dev --quiet --submitter="MLCommons" --hw_name=default --model=retinanet --implementation=reference --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --test_query_count=10 --adr.compiler.tags=gcc --adr.inference-src.version=custom --adr.accuracy-check-src.tags=_repo.${{ github.event.pull_request.head.repo.html_url }},_branch.${{ github.event.pull_request.head.ref }} --adr.inference-src.tags=_repo.${{ github.event.pull_request.head.repo.html_url }},_branch.${{ github.event.pull_request.head.ref }} --adr.inference-src-loadgen.tags=_branch.${{ github.event.pull_request.head.ref }},_repo.${{ github.event.pull_request.head.repo.html_url }} --adr.inference-src-loadgen.version=custom --adr.loadgen.version=custom

.github/workflows/test-rgat.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ jobs:
3232
python-version: ${{ matrix.python-version }}
3333
- name: Install dependencies
3434
run: |
35-
python3 -m pip install mlcflow
36-
mlc pull repo mlcommons@mlperf-automations --branch=dev
37-
#python3 -m pip install mlc-scripts
35+
python3 -m pip install mlc-scripts
3836
- name: Test R-GAT and end to end submission generation
3937
run: |
40-
mlcr run,mlperf,inference,generate-run-cmds,_submission,_short --quiet --submitter="MLCommons" --category=datacenter --hw_name=default --model=rgat --implementation=reference --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --test_query_count=500 --adr.compiler.tags=gcc --adr.inference-src.tags=_branch.$PR_HEAD_REF,_repo.${{ github.event.pull_request.head.repo.html_url }} --adr.inference-src-loadgen.tags=_branch.$PR_HEAD_REF,_repo.${{ github.event.pull_request.head.repo.html_url }} --adr.inference-src-loadgen.version=custom --adr.loadgen.version=custom ${{ matrix.loadgen-flag }}
38+
mlcr run,mlperf,inference,generate-run-cmds,_submission,_short,_r6.0-dev --quiet --submitter="MLCommons" --category=datacenter --hw_name=default --model=rgat --implementation=reference --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --test_query_count=500 --adr.compiler.tags=gcc --adr.inference-src.tags=_branch.$PR_HEAD_REF,_repo.${{ github.event.pull_request.head.repo.html_url }} --adr.inference-src-loadgen.tags=_branch.$PR_HEAD_REF,_repo.${{ github.event.pull_request.head.repo.html_url }} --adr.inference-src-loadgen.version=custom --adr.loadgen.version=custom ${{ matrix.loadgen-flag }}

.github/workflows/test-submission-generation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ on:
1313

1414
jobs:
1515
run-tests:
16-
uses: mlcommons/mlperf-automations/.github/workflows/test-mlperf-inference-submission-generation.yml@subcheckmod_change
16+
uses: mlcommons/mlperf-automations/.github/workflows/test-mlperf-inference-submission-generation.yml@dev
1717
with:
1818
inf-branch: ${{ github.event.pull_request.head.ref }}
1919
inf-repo-url: ${{ github.event.pull_request.head.repo.html_url }}
2020
automation-repo: mlcommons@mlperf-automations
21-
automation-repo-branch: subcheckmod_change
21+
automation-repo-branch: dev

tools/submission/README.md

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Output directory with submission with truncated `mlperf_log_accuracy.json` files
2929
### Summary
3030
The input submission directory is modified with empty directories removed and low accuracy results inferred. Multistream and offline scenario results are also wherever possible. The original input directory is saved in a timestamped directory.
3131

32-
## `submission_checker.py` (Mandatory)
32+
## `submission_checker/main.py` (Mandatory)
3333
### Inputs
3434
**input**: Path to the directory containing one or several submissions.<br>
3535
**version**: Checker version. E.g v1.1, v2.0, v2.1, v3.0, v3.1. <br>
@@ -50,17 +50,73 @@ The below input fields are off by default since v3.1 and are mandatory but can b
5050
**skip-check-power-measure-files**: Flag to avoid checking if the required power measurement files are present
5151

5252
### Summary
53-
Checks a directory that contains one or several submissions. This script can be used by running the following command:
53+
Checks a directory that contains one or several submissions. This script can be used by running the following command (outside the inference repository):
5454
```
55-
python3 submission_checker.py --input <path-to-folder>
55+
python3 -m inference.tools.submission.submission_checker.main
56+
--input <path-to-folder>
5657
[--version <version>]
5758
[--submitter <submitter-name>]
5859
[--csv <path-to-output>]
5960
[--skip_compliance]
6061
[--extra-model-benchmark-map <extra-mapping-string>]
6162
[--submission-exceptions]
63+
[--skip-power-check]
64+
[--skip-meaningful-fields-emptiness-check]
65+
[--skip-check-power-measure-files]
66+
[--skip-empty-files-check]
67+
[--skip-extra-files-in-root-check]
68+
[--skip-extra-accuracy-files-check]
69+
[--scenarios-to-skip]
70+
[--skip-all-systems-have-results-check]
71+
[--skip-calibration-check]
6272
```
6373

74+
### implemented checks
75+
**performance:**
76+
- Check performance detailed log exists
77+
- Check for loadgen errors
78+
- Check for equal issue mode when it is required
79+
- Check the performance sample count used for running the benchmark
80+
- Check loadgen seeds are correct
81+
- Check latency constrain is met
82+
- Check minimun query count is met
83+
- Check minimun duration is met
84+
- Check network requirements
85+
- Check LLM latencies are met (if applies)
86+
- Check loadgen scenario matches with submission scenario or that result can be inferred
87+
88+
**accuracy**
89+
- Check the accuracy metric is correct and over the expected threshold (or within a range if applies)
90+
- Check accuracy json exists and is truncated
91+
- Check for loadgen error
92+
- Check full dataset is used for the accuracy run
93+
94+
**compliance**
95+
- Check compliance directory exists
96+
- Run performance checks for compliance run
97+
- Check accuracy test passes
98+
- Check performance test passes
99+
100+
**measurements**
101+
- Check measurements files exist
102+
- Check the required files are there
103+
- Check the required fields are there
104+
105+
**power**
106+
- Check the required power files are there (if the submission has power)
107+
- Run the external power checks
108+
- Check power metric can be calculated
109+
110+
**system**
111+
- Check system json exists
112+
- Check availability is valid
113+
- Check system type is valid
114+
- Check network fields
115+
- Check required fields are include in system json file
116+
- Check submitter is correct
117+
- Check division is correct
118+
119+
64120
### Outputs
65121
- CSV file containing all the valid results in the directory.
66122
- It raises several errors and logs invalid results.

tools/submission/preprocess_submission.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import shutil
1010
import json
1111

12-
import submission_checker as checker
12+
import submission_checker_old as checker
1313

1414

1515
logging.basicConfig(level=logging.INFO)
@@ -120,6 +120,8 @@ def copy_submission_dir(src, dst, filter_submitter, keep_structure=True):
120120
src, division, submitter, dir)):
121121
target_dir = "results" if dir in [
122122
"compliance", "measurements"] else dir
123+
target_dir = "src" if dir in [
124+
"code"] else target_dir
123125
shutil.copytree(
124126
os.path.join(src, division, submitter, dir),
125127
os.path.join(dst, division, submitter, target_dir),
@@ -301,12 +303,10 @@ def clean_invalid_results(args, log_path, config, system_desc, system_json,
301303
model_compliance_path = model_results_path
302304
model_code_path = os.path.join(
303305
change_folder_name_in_path(
304-
log_path, "results", "code"), model)
306+
log_path, "results", "src"), model)
305307
if not args.nomove_failed_to_open:
306308
target_code_path = change_first_directory_to_open(
307309
model_code_path)
308-
target_code_path = change_folder_name_in_path(
309-
log_path, "code", "src")
310310
target_results_path = change_first_directory_to_open(
311311
model_results_path)
312312
target_measurements_path = change_first_directory_to_open(

tools/submission/submission_checker/__init__.py

Whitespace-only changes.

tools/submission/submission_checker/checks/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)