Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sahilavaran/inference
Browse files Browse the repository at this point in the history
  • Loading branch information
sahilavaran committed Jan 23, 2025
2 parents 3060b71 + 3d868ad commit 2a0fe9b
Show file tree
Hide file tree
Showing 45 changed files with 1,210 additions and 372 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 "[email protected]"
- 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
22 changes: 7 additions & 15 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,9 @@ env:
jobs:
format-code:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- 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:
Expand All @@ -38,7 +32,7 @@ jobs:
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 @@ -58,15 +52,13 @@ 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-[email protected]"
git config --global user.name github-actions[bot]
git config --global user.email "github-actions[bot]@users.noreply.github.com"
# Commit changes
git commit -m '[Automated Commit] Format Codebase'
# Use the PAT to push changes
git push https://x-access-token:${PAT}@github.com/${{ github.repository }} HEAD:${{ github.ref_name }}
# Use the GITHUB_TOKEN to push changes
git push
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-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
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 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
41 changes: 41 additions & 0 deletions docs/benchmarks/language/get-llama3_1-405b-data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
hide:
- toc
---

# Text Summarization using LLAMA3.1-405b

## Dataset

The benchmark implementation run command will automatically download the validation and calibration datasets and do the necessary preprocessing. In case you want to download only the datasets, you can use the below commands.

=== "Validation"

### Get Validation Dataset
```
cm run script --tags=get,dataset,mlperf,inference,llama3,_validation --outdirname=<path to download> -j
```

=== "Calibration"

### Get Calibration Dataset
```
cm run script --tags=get,dataset,mlperf,inference,llama3,_calibration --outdirname=<path to download> -j
```

## Model
The benchmark implementation run command will automatically download the required model and do the necessary conversions. In case you want to only download the official model, you can use the below commands.

Get the Official MLPerf LLAMA3.1-405b Model

=== "Pytorch"

### Pytorch
```
cm run script --tags=get,ml-model,llama3 --outdirname=<path to download> --hf_token=<huggingface access token> -j
```

!!! tip

Downloading llama3.1-405B model from Hugging Face will require an [**access token**](https://huggingface.co/settings/tokens) which could be generated for your account. Additionally, ensure that your account has access to the [llama3.1-405B](https://huggingface.co/meta-llama/Llama-3.1-405B-Instruct) model.

13 changes: 13 additions & 0 deletions docs/benchmarks/language/llama3_1-405b.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
hide:
- toc
---

# Text Summarization using LLAMA3_1-405b

=== "MLCommons-Python"
## MLPerf Reference Implementation in Python

{{ mlperf_inference_implementation_readme (4, "llama3_1-405b-99", "reference", devices=["CPU","CUDA"]) }}

{{ mlperf_inference_implementation_readme (4, "llama3_1-405b-99.9", "reference", devices=["CPU","CUDA"]) }}
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ The currently valid [MLPerf Inference Benchmarks](index_gh.md) as of MLPerf infe
- **Dataset Size**: 788,379
- **QSL Size**: 788,379
- **Number of Parameters**:
- **Reference Model Accuracy**: ACC = ?
- **Reference Model Accuracy**: ACC = 72.86%
- **Server Scenario Latency Constraint**: N/A
- **Equal Issue mode**: True
- **High accuracy variant**: No
Expand Down
Loading

0 comments on commit 2a0fe9b

Please sign in to comment.