Skip to content

Commit

Permalink
Merge branch 'master' into fix_test04
Browse files Browse the repository at this point in the history
  • Loading branch information
sahelib25 authored Jan 15, 2025
2 parents 7694c10 + ab7f700 commit c92fc10
Show file tree
Hide file tree
Showing 110 changed files with 6,428 additions and 1,226 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/auto-update-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Auto-Update Dev Branch from Master

on:
push:
branches:
- master # Trigger workflow on commits to 'dev' branch

jobs:
update-main:
runs-on: ubuntu-latest
permissions:
contents: write # Required to push to protected branches

steps:
- name: Checkout Main Branch
uses: actions/checkout@v4
with:
ref: dev
fetch-depth: 0
ssh-key: ${{ secrets.DEPLOY_KEY }}

- name: Configure Git User
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
- name: Merge auto-update into dev
run: |
git fetch origin master:master
git merge --no-ff master -m "Auto-merge updates from master branch"
- name: Push Changes to Main
run: |
git push origin dev
1 change: 0 additions & 1 deletion .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
branches:
- master
- loadgen-release
- dev
paths:
- loadgen/**

Expand Down
26 changes: 19 additions & 7 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Code formatting"
on:
push:
branches:
- "**"
- "**"

env:
python_version: "3.9"
Expand All @@ -12,24 +12,33 @@ jobs:
format-code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Retrieve secrets from Keeper
id: ksecrets
uses: Keeper-Security/ksm-action@master
with:
keeper-secret-config: ${{ secrets.KSM_CONFIG }}
secrets: |-
v2h4jKiZlJywDSoKzRMnRw/field/Access Token > env:PAT # Fetch PAT and store in environment variable
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{ secrets.DEPLOY_KEY }}

- name: Set up Python ${{ env.python_version }}
uses: actions/setup-python@v3
with:
python-version: ${{ env.python_version }}

- name: Format modified python files
- name: Format modified Python files
env:
filter: ${{ github.event.before }}
run: |
python3 -m pip install autopep8
for FILE in $(git diff --name-only $filter | grep -E '.*\.py$')
do
# Check if the file still exists in the working tree
if [ -f "$FILE" ]; then
if [ -f "$FILE" ] && [ "$FILE" != "tools/submission/power/power_checker.py" ]; then
autopep8 --in-place -a "$FILE"
git add "$FILE"
fi
Expand All @@ -49,12 +58,15 @@ jobs:
done
- name: Commit and push changes
env:
PAT: ${{ env.PAT }} # Use PAT fetched from Keeper
run: |
HAS_CHANGES=$(git diff --staged --name-only)
if [ ${#HAS_CHANGES} -gt 0 ]; then
git config --global user.name mlcommons-bot
git config --global user.email "mlcommons-bot@users.noreply.github.com"
# Commit changes
git commit -m '[Automated Commit] Format Codebase'
git push
fi
# Use the PAT to push changes
git push https://x-access-token:${PAT}@github.com/${{ github.repository }} HEAD:${{ github.ref_name }}
fi
42 changes: 42 additions & 0 deletions .github/workflows/reset-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Reset Current Branch to Upstream After Squash Merge

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to reset (leave blank for current branch)'
required: false
default: 'dev'

jobs:
reset-branch:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Detect Current Branch
if: ${{ inputs.branch == '' }}
run: echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV

- name: Use Input Branch
if: ${{ inputs.branch != '' }}
run: echo "branch=${{ inputs.branch }}" >> $GITHUB_ENV

- name: Add Upstream Remote
run: |
git remote add upstream https://github.com/mlcommons/inference.git
git fetch upstream
- name: Reset Branch to Upstream
run: |
git checkout ${{ env.branch }}
git reset --hard upstream/${{ env.branch }}
if: success()

- name: Force Push to Origin
run: |
git push origin ${{ env.branch }} --force-with-lease
if: success()
2 changes: 1 addition & 1 deletion .github/workflows/test-bert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
python3 -m pip install cm4mlops
- name: Test BERT and end to end submission generation
run: |
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
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.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
2 changes: 1 addition & 1 deletion .github/workflows/test-loadgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-resnet50.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
python3 -m pip install cm4mlops
- name: Test Resnet50 and end to end submission generation
run: |
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 }}
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.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 }}
2 changes: 1 addition & 1 deletion .github/workflows/test-retinanet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
python3 -m pip install cm4mlops
- name: Test Retinanet and end to end submission generation
run: |
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
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.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
38 changes: 38 additions & 0 deletions .github/workflows/test-rgat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test for MLPerf inference rgat submission generation using CM script automation

on:
pull_request:
branches: [ "master", "dev" ]
paths:
- graph/R-GAT/**
- loadgen/**
- tools/submission/**
- .github/workflows/test-rgat.yml
- '!**.md'

env:
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.11" ]
backend: [ "pytorch" ]
loadgen-flag: [ "" ]

steps:
- uses: actions/checkout@v3
- 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 cm4mlops
- name: Test R-GAT and end to end submission generation
run: |
cm run script --tags=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 }}
52 changes: 52 additions & 0 deletions .github/workflows/test-submission-generation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This workflow will test the submission generation using MLPerf Automation

name: CM based Submission Generation

on:
pull_request:
branches: [ "master", "dev" ]
paths:
- '.github/workflows/test-submission-generation.yml'
- '**'
- '!**.md'
jobs:
submission_generation:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [ "3.12" ]
division: ["closed", "open", "closed-open"]
category: ["datacenter", "edge"]
case: ["closed"]
action: ["run", "docker"]
exclude:
- os: macos-latest
- os: windows-latest
- 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: |
pip install cm4mlops
- name: Pull repo where test cases are uploaded
run: |
git clone -b submission-generation-examples https://github.com/mlcommons/inference.git submission_generation_examples
- name: Run Submission Generation - ${{ matrix.case }} ${{ matrix.action }} ${{ matrix.category }} ${{ matrix.division }}
continue-on-error: true
run: |
if [ "${{ matrix.case }}" == "closed" ]; then
description="Test submission - contains closed edge and datacenter"
elif [ "${{ matrix.case }}" == "closed-power" ]; then
description="Test submission - contains closed-power edge and datacenter results"
fi
# Dynamically set the log group to simulate a dynamic step name
echo "::group::$description"
cm ${{ matrix.action }} script --tags=generate,inference,submission --adr.compiler.tags=gcc --version=v5.0 --clean --preprocess_submission=yes --submission_base_dir=mysubmissions --results_dir=$PWD/submission_generation_tests/${{ matrix.case }}/ --run-checker --submitter=MLCommons --tar=yes --division=${{ matrix.division }} --env.CM_DETERMINE_MEMORY_CONFIGURATION=yes --quiet
cm ${{ matrix.action }} script --tags=run,submission,checker --submitter_id_off=mysubmitter_id --tar=yes --submission_dir=mysubmissions/submissions --submission_tar_file=mysubmission.tar.gz
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ loadgen/build/
libmlperf_loadgen.a
__pycache__/
generated/
*.swp
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Please see the [MLPerf Inference benchmark paper](https://arxiv.org/abs/1911.025
primaryClass={cs.LG}
}
```

Please see [here](https://docs.mlcommons.org/inference/benchmarks/) for the MLPerf inference documentation website which includes automated commands to run MLPerf inference benchmarks using different implementations.

## MLPerf Inference v4.1 (submission deadline July 26, 2024)
Expand Down
14 changes: 14 additions & 0 deletions automotive/3d-object-detection/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Reference implementation fo automotive 3D detection benchmark

## TODO: Instructions for dataset download after it is uploaded somewhere appropriate

## TODO: Instructions for checkpoints downloads after it is uploaded somewhere appropriate

## Running with docker
```
docker build -t auto_inference -f dockerfile.gpu .
docker run --gpus=all -it -v <directory to inference repo>/inference/:/inference -v <directory to waymo dataset>/waymo:/waymo --rm auto_inference
cd /inference/automotive/3d-object-detection
python main.py --dataset waymo --dataset-path /waymo/kitti_format/ --lidar-path <checkpoint_path>/pp_ep36.pth --segmentor-path <checkpoint_path>/best_deeplabv3plus_resnet50_waymo_os16.pth --mlperf_conf /inference/mlperf.conf
Loading

0 comments on commit c92fc10

Please sign in to comment.