Skip to content

Commit 2a0aeb2

Browse files
authored
Merge branch 'master' into fix_test04
2 parents b40a42c + dd9be96 commit 2a0aeb2

File tree

589 files changed

+63486
-18344
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

589 files changed

+63486
-18344
lines changed

.github/CODEOWNERS

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# These owners will be the default owners for everything in the repo.
22
# Unless a later match takes precedence,they will be requested for review when someone opens a pull request.
33
* @mlcommons/wg-inference
4+
5+
/CODEOWNERS @mlcommons/staff

.github/workflows/build_wheels.yml

+117-13
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,141 @@ name: Build loadgen wheels and release them into PYPI
33
on:
44
release:
55
types: [published]
6+
push:
7+
branches:
8+
- master
9+
- loadgen-release
10+
- dev
11+
paths:
12+
- loadgen/**
613

714
jobs:
15+
update_version:
16+
name: Update version only on ubuntu but used by windows and macos
17+
if: github.repository_owner == 'mlcommons'
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 2
23+
ssh-key: ${{ secrets.DEPLOY_KEY }}
24+
25+
# Check if VERSION.txt file has changed in this push
26+
- name: Check if VERSION.txt file has changed
27+
id: version_changed
28+
run: |
29+
echo "version_changed=false" >> $GITHUB_ENV
30+
echo "new_version=" >> $GITHUB_ENV # Initialize with empty value
31+
if git diff --name-only HEAD~1 | grep -q "VERSION.txt"; then
32+
echo "VERSION.txt file has been modified"
33+
echo "version_changed=true" >> $GITHUB_ENV
34+
new_version=$(cat loadgen/VERSION.txt)
35+
echo "new_version=$new_version" >> $GITHUB_ENV
36+
else
37+
echo "VERSION.txt file has NOT been modified"
38+
fi
39+
40+
# Step 4: Increment version if VERSION.txt was not changed
41+
- name: Increment version if necessary
42+
id: do_version_increment
43+
if: env.version_changed == 'false'
44+
run: |
45+
cd loadgen
46+
# Check if VERSION file exists, else initialize it
47+
if [ ! -f VERSION.txt ]; then
48+
echo "0.0.0" > VERSION.txt
49+
fi
50+
51+
version=$(cat VERSION.txt)
52+
IFS='.' read -r major minor patch <<< "$version"
53+
patch=$((patch + 1))
54+
new_version="$major.$minor.$patch"
55+
echo $new_version > VERSION.txt
56+
echo "New version: $new_version"
57+
echo "new_version=$new_version" >> $GITHUB_ENV
58+
59+
# Step 5: Commit the updated version to the repository
60+
- name: Commit updated version
61+
if: env.version_changed == 'false'
62+
run: |
63+
cd loadgen
64+
git config --global user.name "${{ github.actor }}"
65+
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
66+
git add VERSION.txt
67+
git commit -m "Increment version to $new_version"
68+
git push
69+
870
build_wheels:
971
name: Build wheels on ${{ matrix.os }}
72+
needs: update_version
1073
runs-on: ${{ matrix.os }}
1174
strategy:
75+
fail-fast: false
1276
matrix:
13-
os: [ubuntu-latest, windows-latest, macOS-latest]
77+
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
1478

1579
steps:
1680
- uses: actions/checkout@v3
1781

1882
- uses: actions/setup-python@v3
1983

2084
- name: Install requirements
21-
run: python -m pip install cibuildwheel==2.11.4 twine==4.0.2
85+
run: python -m pip install cibuildwheel twine build
2286

23-
- name: Init pybind11 submodule
87+
- name: Build src dist
88+
if: ${{ matrix.os == 'ubuntu-latest' }}
2489
run: |
25-
git submodule init third_party/pybind
26-
git submodule update third_party/pybind
90+
python -m build --sdist --outdir wheels loadgen
2791
2892
- name: Build wheels
29-
run: python -m cibuildwheel loadgen/ --output-dir wheels
30-
env:
31-
CIBW_ENVIRONMENT: "CFLAGS='-std=c++14'"
32-
CIBW_BUILD: 'cp3{6,7,8,9,10}-*'
93+
run: git pull && python -m cibuildwheel loadgen/ --output-dir wheels
3394

34-
- uses: actions/upload-artifact@v3
95+
# Save wheels as artifacts
96+
- name: Upload built wheels
97+
uses: actions/upload-artifact@v4
3598
with:
36-
path: ./wheels/*.whl
99+
name: wheels-${{ matrix.os }}
100+
path: wheels
37101

38-
- name: Publish package to PyPI
39-
run: python -m twine upload wheels/* -u __token__ -p ${{ secrets.PYPI_API_TOKEN }}
102+
publish_wheels:
103+
needs: build_wheels # Wait for the build_wheels job to complete
104+
runs-on: ubuntu-latest # Only run this job on Linux
105+
environment: release
106+
permissions:
107+
# IMPORTANT: this permission is mandatory for trusted publishing
108+
id-token: write
109+
steps:
110+
- uses: actions/checkout@v3
111+
112+
# Download the built wheels from ubuntu
113+
- name: Download Ubuntu wheels
114+
uses: actions/download-artifact@v4
115+
with:
116+
name: wheels-ubuntu-latest
117+
path: wheels
118+
# Download the built wheels from macOS-latest
119+
- name: Download macOS-latest wheels
120+
uses: actions/download-artifact@v4
121+
with:
122+
name: wheels-macos-latest
123+
path: wheels
124+
# Download the built wheels from macOS-13 (x86)
125+
- name: Download macOS-13 (x86) wheels
126+
uses: actions/download-artifact@v4
127+
with:
128+
name: wheels-macos-13
129+
path: wheels
130+
# Download the built wheels from Windows
131+
- name: Download Windows wheels
132+
uses: actions/download-artifact@v4
133+
with:
134+
name: wheels-windows-latest
135+
path: wheels
136+
- name: Publish
137+
uses: pypa/gh-action-pypi-publish@release/v1
138+
with:
139+
verify-metadata: true
140+
skip-existing: true
141+
packages-dir: wheels
142+
repository-url: https://upload.pypi.org/legacy/
143+
verbose: true

.github/workflows/cla.yml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
jobs:
1010
cla-check:
11+
if: github.repository_owner == 'mlcommons'
1112
runs-on: ubuntu-latest
1213
steps:
1314
- name: "MLCommons CLA bot check"

.github/workflows/format.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Automatic code formatting
2+
name: "Code formatting"
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
8+
env:
9+
python_version: "3.9"
10+
11+
jobs:
12+
format-code:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
ssh-key: ${{ secrets.DEPLOY_KEY }}
19+
- name: Set up Python ${{ env.python_version }}
20+
uses: actions/setup-python@v3
21+
with:
22+
python-version: ${{ env.python_version }}
23+
24+
- name: Format modified python files
25+
env:
26+
filter: ${{ github.event.before }}
27+
run: |
28+
python3 -m pip install autopep8
29+
for FILE in $(git diff --name-only $filter | grep -E '.*\.py$')
30+
do
31+
# Check if the file still exists in the working tree
32+
if [ -f "$FILE" ]; then
33+
autopep8 --in-place -a "$FILE"
34+
git add "$FILE"
35+
fi
36+
done
37+
38+
- name: Format modified C++ files
39+
env:
40+
filter: ${{ github.event.before }}
41+
run: |
42+
for FILE in $(git diff --name-only $filter | grep -E '.*\.(cc|cpp|h|hpp)$')
43+
do
44+
# Check if the file still exists in the working tree
45+
if [ -f "$FILE" ]; then
46+
clang-format -i -style=file $FILE
47+
git add $FILE
48+
fi
49+
done
50+
51+
- name: Commit and push changes
52+
run: |
53+
HAS_CHANGES=$(git diff --staged --name-only)
54+
if [ ${#HAS_CHANGES} -gt 0 ]; then
55+
git config --global user.name mlcommons-bot
56+
git config --global user.email "[email protected]"
57+
# Commit changes
58+
git commit -m '[Automated Commit] Format Codebase'
59+
git push
60+
fi

.github/workflows/publish.yaml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Publish site
4+
5+
6+
on:
7+
release:
8+
types: [published]
9+
push:
10+
branches:
11+
- master
12+
- docs
13+
14+
jobs:
15+
16+
publish:
17+
name: Publish the site
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout repository normally
22+
uses: actions/checkout@v3
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: "3.11"
28+
29+
- name: Install Mkdocs
30+
run: pip install -r docs/requirements.txt
31+
32+
- name: Run Mkdocs deploy
33+
run: mkdocs gh-deploy --force

.github/workflows/test-bert.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
- .github/workflows/test-bert.yml
1313
- '!**.md'
1414

15+
env:
16+
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
17+
1518
jobs:
1619
build:
1720

@@ -30,9 +33,7 @@ jobs:
3033
python-version: ${{ matrix.python-version }}
3134
- name: Install dependencies
3235
run: |
33-
python3 -m pip install cmind
34-
cm pull repo mlcommons@ck
35-
cm run script --quiet --tags=get,sys-utils-cm
36+
python3 -m pip install cm4mlops
3637
- name: Test BERT and end to end submission generation
3738
run: |
38-
cm run script --tags=run,mlperf,inference,generate-run-cmds,_submission,_short --quiet --submitter="MLCommons" --hw_name=default --model=bert-99 --implementation=reference --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --adr.compiler.tags=gcc --adr.inference-src.version=custom --adr.inference-src.env.CM_GIT_CHECKOUT=${{ github.event.pull_request.head.ref }} --adr.inference-src.env.CM_GIT_URL=${{ github.event.pull_request.head.repo.html_url }} --target_qps=1
39+
cm run script --tags=run,mlperf,inference,generate-run-cmds,_submission,_short --quiet --submitter="MLCommons" --hw_name=default --model=bert-99 --implementation=reference --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --adr.compiler.tags=gcc --adr.inference-src.version=custom --adr.inference-src.tags=_repo.${{ github.event.pull_request.head.repo.html_url }},_branch.$PR_HEAD_REF --adr.loadgen.version=custom

.github/workflows/test-loadgen.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@ on:
1111
- .github/workflows/test-loadgen.yml
1212
- '!**.md'
1313

14+
env:
15+
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
16+
1417
jobs:
1518
build:
1619

1720
runs-on: ubuntu-latest
1821
strategy:
1922
fail-fast: false
2023
matrix:
21-
python-version: ["3.8", "3.9", "3.10"]
24+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
2225

2326
steps:
2427
- uses: actions/checkout@v3
@@ -28,8 +31,7 @@ jobs:
2831
python-version: ${{ matrix.python-version }}
2932
- name: Install dependencies
3033
run: |
31-
python3 -m pip install cmind
32-
cm pull repo mlcommons@ck
34+
python3 -m pip install cm4mlops
3335
- name: Test Loadgen
3436
run: |
35-
cm run script --tags=get,mlperf,inference,loadgen --quiet --version=custom --adr.inference-src.env.CM_GIT_CHECKOUT=${{ github.event.pull_request.head.ref }} --adr.inference-src.env.CM_GIT_URL=${{ github.event.pull_request.head.repo.html_url }}
37+
cm run script --tags=get,mlperf,inference,loadgen --quiet --version=custom --adr.inference-src.tags=_repo.${{ github.event.pull_request.head.repo.html_url }},_branch.$PR_HEAD_REF --adr.loadgen.tags=_no-compilation-warnings

.github/workflows/test-resnet50.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ on:
88
branches: [ "master", "dev" ]
99
paths:
1010
- vision/classification_and_detection/**
11+
- loadgen/**
1112
- tools/submission/**
1213
- .github/workflows/test-resnet50.yml
1314
- '!**.md'
1415

16+
env:
17+
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
18+
1519
jobs:
1620
build:
1721

@@ -21,6 +25,7 @@ jobs:
2125
matrix:
2226
python-version: [ "3.9" ]
2327
backend: [ "onnxruntime", "tf" ]
28+
loadgen-flag: [ "", "--adr.loadgen.tags=_from-pip --pip_loadgen=yes" ]
2429

2530
steps:
2631
- uses: actions/checkout@v3
@@ -30,9 +35,7 @@ jobs:
3035
python-version: ${{ matrix.python-version }}
3136
- name: Install dependencies
3237
run: |
33-
python3 -m pip install cmind
34-
cm pull repo mlcommons@ck
35-
cm run script --quiet --tags=get,sys-utils-cm
38+
python3 -m pip install cm4mlops
3639
- name: Test Resnet50 and end to end submission generation
3740
run: |
38-
cm run script --tags=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.env.CM_GIT_CHECKOUT=${{ github.event.pull_request.head.ref }} --adr.inference-src.version=custom --adr.inference-src.env.CM_GIT_URL=${{ github.event.pull_request.head.repo.html_url }}
41+
cm run script --tags=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.$PR_HEAD_REF,_repo.${{ github.event.pull_request.head.repo.html_url }} --adr.inference-src.version=custom --adr.loadgen.version=custom ${{ matrix.loadgen-flag }}

.github/workflows/test-retinanet.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
- .github/workflows/test-retinanet.yml
1313
- '!**.md'
1414

15+
env:
16+
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
17+
1518
jobs:
1619
build:
1720

@@ -30,9 +33,7 @@ jobs:
3033
python-version: ${{ matrix.python-version }}
3134
- name: Install dependencies
3235
run: |
33-
python3 -m pip install cmind
34-
cm pull repo mlcommons@ck
35-
cm run script --quiet --tags=get,sys-utils-cm
36+
python3 -m pip install cm4mlops
3637
- name: Test Retinanet and end to end submission generation
3738
run: |
38-
cm run script --tags=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.env.CM_GIT_CHECKOUT=${{ github.event.pull_request.head.ref }} --adr.inference-src.env.CM_GIT_URL=${{ github.event.pull_request.head.repo.html_url }}
39+
cm run script --tags=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.$PR_HEAD_REF --adr.loadgen.version=custom

.github/workflows/test-rnnt.yml

100755100644
+5-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ name: Test for MLPerf inference rnnt submission generation using CM script autom
55

66
on:
77
pull_request:
8-
branches: [ "master", "dev" ]
8+
branches: [ "master-retired", "dev-retired" ]
99
paths:
1010
- speech_recognition/rnnt/**
1111
- tools/submission/**
1212
- .github/workflows/test-rnnt.yml
1313
- '!**.md'
1414

15+
env:
16+
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
17+
1518
jobs:
1619
build:
1720

@@ -36,4 +39,4 @@ jobs:
3639
cm run script --quiet --tags=get,sys-utils-cm
3740
- name: Test RNNT and end to end submission generation
3841
run: |
39-
cm run script --tags=run,mlperf,inference,generate-run-cmds,_performance-only --quiet --submitter="MLCommons" --hw_name=default --model=rnnt --implementation=reference --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --precision=${{ matrix.precision }} --adr.compiler.tags=gcc --adr.inference-src.version=custom --adr.inference-src.env.CM_GIT_CHECKOUT=${{ github.event.pull_request.head.ref }} --adr.inference-src.env.CM_GIT_URL=${{ github.event.pull_request.head.repo.html_url }} --adr.ml-engine-pytorch.version=1.13.0 --adr.ml-engine-torchvision.version=0.14.1 --adr.librosa.version_max=0.9.1
42+
cm run script --tags=run,mlperf,inference,generate-run-cmds,_performance-only --quiet --submitter="MLCommons" --hw_name=default --model=rnnt --implementation=reference --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --precision=${{ matrix.precision }} --adr.compiler.tags=gcc --adr.inference-src.version=custom --adr.inference-src.env.CM_GIT_CHECKOUT=$PR_HEAD_REF --adr.inference-src.env.CM_GIT_URL=${{ github.event.pull_request.head.repo.html_url }} --adr.ml-engine-pytorch.version=1.13.0 --adr.ml-engine-torchvision.version=0.14.1 --adr.librosa.version_max=0.9.1

0 commit comments

Comments
 (0)