-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #444 from mlcommons/mlperf-inference
Sync: Mlperf inference
- Loading branch information
Showing
15 changed files
with
190 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# This workflow will run configured tests for any updated CM scripts | ||
name: Individual CM script Tests | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main", "mlperf-inference", "dev" ] | ||
paths: | ||
- 'script/**_cm.json' | ||
- 'script/**_cm.yml' | ||
|
||
jobs: | ||
run-script-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Checkout' | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
- name: Get changed files | ||
id: getfile | ||
run: | | ||
git remote add upstream ${{ github.event.pull_request.base.repo.clone_url }} | ||
git fetch upstream | ||
echo "files=$(git diff upstream/${{ github.event.pull_request.base.ref }} --name-only | xargs)" >> $GITHUB_OUTPUT | ||
- name: RUN Script Tests | ||
run: | | ||
echo ${{ steps.getfile.outputs.files }} | ||
for file in ${{ steps.getfile.outputs.files }}; do | ||
echo $file | ||
done | ||
python3 -m pip install cmind | ||
cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} | ||
python3 tests/script/process_tests.py ${{ steps.getfile.outputs.files }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# This workflow will test the submission generation capability of CM f | ||
|
||
name: CM based Submission Generation | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main", "dev", "mlperf-inference" ] | ||
paths: | ||
- '.github/workflows/test-submission-generation-non-cm-based-benchmarks.yml' | ||
# - '**' # kept on for all the path instead of submission generation CM script so that this could help in trapping any bugs in any recent submission checker modification also | ||
# - '!**.md' | ||
jobs: | ||
Case-3: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: [ "3.12" ] | ||
division: ["closed", "open"] | ||
category: ["datacenter", "edge"] | ||
exclude: | ||
- os: macos-latest | ||
- os: windows-latest | ||
- division: "open" | ||
- category: "edge" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install cmind | ||
cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} | ||
- name: Pull repo where test cases are uploaded | ||
run: | | ||
cm pull repo anandhu-eng@inference --checkout=submission-generation-tests | ||
- name: Submission generation(model_mapping.json not present but model name is matching with the official one in submission checker) - ${{ matrix.category }} ${{ matrix.division }} | ||
run: | | ||
cm run script --tags=generate,inference,submission --clean --preprocess_submission=yes --results_dir=$HOME/CM/repos/anandhu-eng@inference/case-3/ --run-checker --submitter=MLCommons --tar=yes --env.CM_TAR_OUTFILE=submission.tar.gz --division=${{ matrix.division }} --category=${{ matrix.category }} --env.CM_DETERMINE_MEMORY_CONFIGURATION=yes --quiet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
#!/bin/bash | ||
# Safe execution of a command stored in a variable | ||
cmd="${CM_SYS_UTIL_INSTALL_CMD}" | ||
echo "$cmd" | ||
|
||
cmd=${CM_SYS_UTIL_INSTALL_CMD} | ||
echo $cmd | ||
eval $cmd | ||
test $? -eq 0 || exit $? | ||
# Execute the command and capture the exit status directly | ||
if ! eval "$cmd"; then | ||
echo "Command failed with status $?" | ||
if [[ "${CM_TMP_FAIL_SAFE}" == 'yes' ]]; then | ||
# Exit safely if fail-safe is enabled | ||
echo "Fail-safe is enabled, exiting with status 0" | ||
exit 0 | ||
else | ||
# Otherwise exit with the actual error status | ||
exit $? | ||
fi | ||
else | ||
#echo "Command succeeded" | ||
exit 0 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import sys | ||
import os | ||
import cmind as cm | ||
import check as checks | ||
import json | ||
import yaml | ||
|
||
files=sys.argv[1:] | ||
|
||
for file in files: | ||
print(file) | ||
if not os.path.isfile(file) or not "script" in file: | ||
continue | ||
if not file.endswith("_cm.json") and not file.endswith("_cm.yaml"): | ||
continue | ||
script_path = os.path.dirname(file) | ||
f = open(file) | ||
if file.endswith(".json"): | ||
data = json.load(f) | ||
elif file.endswith(".yaml"): | ||
data = yaml.safe_load(f) | ||
uid = data['uid'] | ||
|
||
r = cm.access({'action':'test', 'automation':'script', 'artifact': uid, 'quiet': 'yes', 'out': 'con'}) | ||
checks.check_return(r) |