Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final cleanup and github action, windows native run enabled #30

Merged
merged 78 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
d2e7fc5
Added github action for POC
arjunsuresh Jun 14, 2024
404611f
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 14, 2024
1996c55
Support gh_token for POC
arjunsuresh Jun 14, 2024
b00ca51
Merge pull request #27 from GATEOverflow/poc
arjunsuresh Jun 14, 2024
10971ad
Merge remote-tracking branch 'go/main'
arjunsuresh Jun 14, 2024
e86d9fb
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 14, 2024
212ec3b
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 14, 2024
0ac39b5
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 14, 2024
63c1b59
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 14, 2024
7622de2
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 14, 2024
665f610
Merge branch 'GATEOverflow:main' into main
arjunsuresh Jun 14, 2024
404cbd7
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 14, 2024
8986195
Merge pull request #1 from arjunsuresh/main
arjunsuresh Jun 14, 2024
385c8bf
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 14, 2024
f44349b
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 14, 2024
a314f5b
Merge branch 'GATEOverflow:main' into main
arjunsuresh Jun 14, 2024
dccb70a
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 14, 2024
4373caf
Merge branch 'GATEOverflow:main' into main
arjunsuresh Jun 14, 2024
303b5b3
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 15, 2024
81b65dc
Merge branch 'GATEOverflow:main' into main
arjunsuresh Jun 15, 2024
e54d534
Fix docker mount permission issue
arjunsuresh Jun 16, 2024
6e080fd
Merge branch 'poc' into main
arjunsuresh Jun 16, 2024
d87f203
Merge pull request #28 from GATEOverflow/main
arjunsuresh Jun 16, 2024
a15ac6a
Merge branch 'GATEOverflow:main' into main
arjunsuresh Jun 16, 2024
ea30e8d
Remove test_query_count in poc test
arjunsuresh Jun 16, 2024
8e2e8c7
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 16, 2024
ebb3c57
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 16, 2024
7651166
Use pip install for loadgen
arjunsuresh Jun 16, 2024
ec93d18
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 16, 2024
8d64700
Merge branch 'main' into main
arjunsuresh Jun 16, 2024
07dcd8e
Build loadgen from src by default
arjunsuresh Jun 16, 2024
2b47dc4
Merge branch 'main' into main
arjunsuresh Jun 16, 2024
b95ef7d
Build loadgen from src by default
arjunsuresh Jun 16, 2024
7ff9c8e
Merge branch 'poc' into main
arjunsuresh Jun 16, 2024
e6b5bc0
Merge branch 'GATEOverflow:main' into main
arjunsuresh Jun 16, 2024
bb69898
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 16, 2024
7b0ab79
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 16, 2024
dba4e5a
Merge pull request #2 from arjunsuresh/main
arjunsuresh Jun 16, 2024
ca0b8c7
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 16, 2024
f5f1557
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 16, 2024
745ee56
Merge branch 'main' into main
arjunsuresh Jun 16, 2024
d093af7
Merge pull request #29 from GATEOverflow/main
arjunsuresh Jun 16, 2024
ab93a91
Cleanup the instructions
arjunsuresh Jun 16, 2024
3f1f17b
Merge pull request #4 from mlcommons/poc
arjunsuresh Jun 16, 2024
0e7850f
Merge branch 'main' into main
arjunsuresh Jun 16, 2024
752117c
Added more run options and link to github action
arjunsuresh Jun 16, 2024
810b975
Cleaned up readme
arjunsuresh Jun 16, 2024
3f53539
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 16, 2024
ebbcaf6
Merge branch 'main' into main
arjunsuresh Jun 16, 2024
0dcd788
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 16, 2024
0f81ab9
Merge branch 'main' into main
arjunsuresh Jun 16, 2024
844ddbc
Support macos and windows wheels
arjunsuresh Jun 16, 2024
5ffc14a
Merge branch 'poc' into main
arjunsuresh Jun 16, 2024
ee98911
Merge branch 'main' into main
arjunsuresh Jun 16, 2024
05c36d2
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 16, 2024
e62d907
Merge branch 'main' into main
arjunsuresh Jun 16, 2024
8b93b2e
Added OS independent path for the reference implementation run command
arjunsuresh Jun 16, 2024
1fc21cc
Merge branch 'poc' into main
arjunsuresh Jun 16, 2024
04d418e
Merge branch 'main' into main
arjunsuresh Jun 16, 2024
7c74602
Fix typo
arjunsuresh Jun 16, 2024
9833534
Merge branch 'poc' into main
arjunsuresh Jun 16, 2024
24783cd
Merge branch 'main' into main
arjunsuresh Jun 16, 2024
32e250d
Fix numpy version for ABTF
arjunsuresh Jun 16, 2024
84ef156
Merge branch 'main' into main
arjunsuresh Jun 16, 2024
184229b
Merge pull request #3 from arjunsuresh/main
arjunsuresh Jun 16, 2024
745bf8c
Merge pull request #31 from GATEOverflow/main
arjunsuresh Jun 16, 2024
88f9e9e
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 16, 2024
0d6e5ff
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 16, 2024
1e124ff
Merge pull request #5 from arjunsuresh/main
arjunsuresh Jun 16, 2024
db4215b
Update cla.yml
arjunsuresh Jun 16, 2024
f1f0129
Merge branch 'GATEOverflow:main' into main
arjunsuresh Jun 16, 2024
53fd245
Update test-mlperf-inference-abtf-poc.yml
arjunsuresh Jun 16, 2024
374955a
Merge pull request #6 from arjunsuresh/main
arjunsuresh Jun 16, 2024
e01fac2
fix file path on windows
arjunsuresh Jun 16, 2024
b620baa
use absolute path on windows
arjunsuresh Jun 16, 2024
ae6d365
use absolute path on windows
arjunsuresh Jun 16, 2024
9267a8b
Merge branch 'poc' into main
arjunsuresh Jun 17, 2024
b72dc44
Merge pull request #32 from GATEOverflow/main
arjunsuresh Jun 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

jobs:
cla-check:
if: github.repository_owner == 'mlcommons'
runs-on: ubuntu-latest
steps:
- name: "MLCommons CLA bot check"
Expand Down
97 changes: 97 additions & 0 deletions .github/workflows/test-mlperf-inference-abtf-poc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: MLPerf inference ABTF POC Test

on:
pull_request_target:
branches: [ "main", "poc" ]
paths:
- '.github/workflows/test-mlperf-inference-abtf-poc.yml'
- '**'
- '!**.md'

jobs:
build_ubuntu:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-20.04, ubuntu-24.04]
python-version: [ "3.8", "3.12" ]
backend: [ "pytorch" ]
implementation: [ "python" ]
exclude:
- os: ubuntu-24.04
python-version: "3.8"

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: |
pip install cm4mlops
cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }}
cm run script --quiet --tags=get,sys-utils-cm
- name: Test MLPerf Inference ABTF POC using ${{ matrix.backend }} on docker
run: |
cm run script --tags=run-abtf,inference,_poc-demo --adr.compiler.tags=gcc --quiet --docker --docker_it=no -v --gh_token=${{ secrets.ABTF_ACCESS_TOKEN }}

build_macos:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, macos-13]
python-version: [ "3.9", "3.11", "3.12" ]
backend: [ "pytorch" ]
implementation: [ "python" ]
exclude:
- os: windows-latest
python-version: "3.9"
- os: windows-latest
python-version: "3.12"

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: |
pip install cm4mlops
cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }}
- name: Test MLPerf Inference ABTF POC using ${{ matrix.backend }} natively
run: |
cm run script --tags=run-abtf,inference,_poc-demo --adr.compiler.tags=gcc --quiet --env.CM_MLPERF_LOADGEN_BUILD_FROM_SRC=off -v --gh_token=${{ secrets.ABTF_ACCESS_TOKEN }}

build_windows:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
python-version: [ "3.11" ]
backend: [ "pytorch" ]
implementation: [ "python" ]

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: |
git config --system core.longpaths true
pip install cm4mlops
cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }}
- name: Test MLPerf Inference ABTF POC using ${{ matrix.backend }} natively
run: |
cm run script --tags=run-abtf,inference,_poc-demo --quiet --env.CM_MLPERF_LOADGEN_BUILD_FROM_SRC=off --adr.raw-dataset-mlcommons-cognata.tags=_gdrive -v --gh_token=${{ secrets.ABTF_ACCESS_TOKEN }}



48 changes: 32 additions & 16 deletions docs/run/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

## Install Dependencies

MLCommons CM Automation framework is used to run the POC reference. CM needs to be installed on the computer running the benchmark and CM requires Python 3.7+. Please follow the instructions to install CM as described in the link below:
MLCommons CM Automation framework is used to run the POC reference. CM requires Python 3.7+, git, python3-pip and python3-venv. If these dependencies are present you can do

* [CM Installation Page](https://docs.mlcommons.org/ck/install)
Activate a venv for CM (Not mandatory but recommended)
```
python3 -m venv cm
source cm/bin/activate
```

Install CM and pull the needed repositories
```
pip install cm4abtf
```

More installation details can be found at [CM Installation Page](https://docs.mlcommons.org/ck/install)

Using an Ubuntu example, run `cm` in the terminal and if CM successfully installed, expect the following output:

Expand All @@ -15,30 +26,34 @@ Using an Ubuntu example, run `cm` in the terminal and if CM successfully install

Note: the `(cm)` indicates that Python `venv` is active.

Now, the `cm` cli commands will be used to run the POC reference.

The computer running the POC reference needs Docker. Follow instructions described in the link below:

* [Install Docker Engine](https://docs.docker.com/engine/install/)

Note: if you're running Ubuntu, CM automatically installs Docker when running the benchmark.

## Download Repositories
Note: if you're running Ubuntu, CM automatically installs Docker when running the benchmark. We have tested the run on Ubuntu, RHEL, macOS and Windows

Start by using CM to pull the necessary repositories.

```bash
cm pull repo gateoverflow@cm4mlops
cm pull repo mlcommons@cm4abtf
```

Now, the `cm` cli commands will be used to run the POC reference.

## Start the Benchmark

By running the script below, you are downloading the POC container and dataset, then launching the benchmark. All in one command!

```
cm run script --tags=run-abtf,_poc-demo --quiet --docker --gh_token=<GH_TOKEN> --docker_cache=no
cm run script --tags=run-abtf,_poc-demo \
--quiet \
--docker \
--gh_token=<GH_TOKEN> \
--docker_cache=no
```
!!! tip
* Use `--rerun` to force overwrite the previously generated results
* Use `--env.CM_MLPERF_LOADGEN_BUILD_FROM_SRC=off` to use the prebuilt MLPerf Loadgen binary and not do a source compilation
* Use `--docker_os=[rhel|arch|ubuntu]` to change the docker OS
* Use `--docker_os_version=[8|9]` for `RHEL`, `[24.04,22.04,20.04]` for `ubuntu` and `[latest]` for `arch`
* Use `--docker_base_image=[IMAGE_NAME]` to override the default base image for docker
* Skip `--docker` to do the run on the host machine without using a docker
* Github actions for this run can be seen [here](https://github.com/mlcommons/cm4abtf/actions/workflows/test-mlperf-inference-abtf-poc.yml)

Depending on the computer used and internet connection, this can take a few minutes.

Expand Down Expand Up @@ -66,5 +81,6 @@ If you face any issues, please don't hesitate to reach out!
* Join the [MLCommons Automotive Discord Server](https://discord.gg/jBxH9GvftZ)

## Contributors

TBD
* The POC reference model is trained and developed by Radoyeh Shojaei
* MLPerf Loadgen integration for the POC reference is done by Grigori Fursin and Radoyeh Shojaei
* CM workflow for the POC reference is done by Arjun Suresh and Grigori Fursin
2 changes: 2 additions & 0 deletions script/app-abtf-inference/_cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ deps:

docker:
cm_repo: gateoverflow@cm4mlops
use_host_group_id: True
use_host_user_id: True
real_run: false
interactive: True
cm_repos: 'cm pull repo mlcommons@cm4abtf --checkout=poc'
Expand Down
25 changes: 15 additions & 10 deletions script/demo-ml-model-abtf-cognata-pytorch-loadgen/_cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ tags:
default_env:
CM_MLPERF_LOADGEN_MODE: accuracy
CM_MLPERF_LOADGEN_SCENARIO: Offline
CM_MLPERF_LOADGEN_BUILD_FROM_SRC: 'on'
CM_OUTPUT_FOLDER_NAME: test_results
CM_MLPERF_RUN_STYLE: test
CM_TEST_QUERY_COUNT: '10'
Expand Down Expand Up @@ -242,16 +243,6 @@ deps:
- ray


## Transformers
- tags: get,generic-python-lib,_transformers
names:
- ml-engine-transformers
enable_if_env:
CM_MODEL:
- bert-99
- bert-99.9
- gptj-99
- gptj-99.9

## Tensorflow
- tags: get,generic-python-lib,_tensorflow
Expand All @@ -274,10 +265,22 @@ deps:


# Install MLPerf loadgen
- tags: get,generic-python-lib,_package.mlcommons-loadgen
enable_if_env:
CM_MLPERF_LOADGEN_BUILD_FROM_SRC:
- "off"
names:
- loadgen
- mlperf-inference-loadgen

- tags: get,loadgen
enable_if_any_env:
CM_MLPERF_LOADGEN_BUILD_FROM_SRC:
- "on"
names:
- loadgen
- mlperf-inference-loadgen
- mlperf-inference-loadgen-from-src


#
Expand Down Expand Up @@ -402,6 +405,8 @@ variations:
deps:
- tags: get,generic-python-lib,_opencv-python
- tags: get,generic-python-lib,_numpy
version_max: "1.26.4"
version_max_usable: "1.26.4"
- tags: get,generic-python-lib,_pycocotools
- tags: get,generic-python-lib,_package.torchmetrics
- tags: get,generic-python-lib,_package.faster-coco-eval
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def get_run_cmd_reference(os_info, env, scenario_extra_options, mode_extra_optio
path_to_model = env.get('CM_MLPERF_CUSTOM_MODEL_PATH', env.get('CM_ML_MODEL_FILE_WITH_PATH', env.get('CM_ML_MODEL_CODE_WITH_PATH')))
env['MODEL_FILE'] = path_to_model

cmd = env['CM_PYTHON_BIN_WITH_PATH'] + " python/main.py --profile "+env['CM_MODEL']+"-"+env['CM_MLPERF_BACKEND'] + \
cmd = env['CM_PYTHON_BIN_WITH_PATH'] + " " + os.path.join(run_dir, "python", "main.py") + " --profile "+env['CM_MODEL']+"-"+env['CM_MLPERF_BACKEND'] + \
" --model=" + q + path_to_model + q + \
" --dataset=" + env["CM_MLPERF_VISION_DATASET_OPTION"] + \
" --dataset-path=" + q + cognata_dataset_path + q + \
Expand Down
1 change: 1 addition & 0 deletions script/run-abtf-inference-demo/_cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ input_mapping:
save_console_log: CM_SAVE_CONSOLE_LOG
execution_mode: CM_MLPERF_RUN_STYLE
find_performance: CM_MLPERF_FIND_PERFORMANCE_MODE
gh_token: CM_GH_TOKEN
gpu_name: CM_NVIDIA_GPU_NAME
hw_name: CM_HW_NAME
hw_notes_extra: CM_MLPERF_SUT_SW_NOTES_EXTRA
Expand Down
Loading