-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature][refactor] Optimum-Benchmark API (#118)
- Loading branch information
1 parent
777070b
commit 6be304d
Showing
142 changed files
with
2,852 additions
and
2,191 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
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,32 @@ | ||
name: API CPU Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
run_api_cpu_tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install -e .[testing,timm,diffusers] | ||
- name: Run tests | ||
run: pytest -k "api and cpu" |
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,53 @@ | ||
name: API CUDA Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build_image_and_run_api_cuda_tests: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
image: | ||
[ | ||
{ torch_cuda: cu121, cuda_version: 12.1.1 }, | ||
{ torch_cuda: cu118, cuda_version: 11.8.0 }, | ||
] | ||
|
||
runs-on: hf-dgx-01 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build image | ||
run: docker build | ||
--file docker/cuda.dockerfile | ||
--build-arg USER_ID=$(id -u) | ||
--build-arg GROUP_ID=$(id -g) | ||
--build-arg TORCH_CUDA=${{ matrix.image.torch_cuda }} | ||
--build-arg CUDA_VERSION=${{ matrix.image.cuda_version }} | ||
--tag opt-bench-cuda:${{ matrix.image.cuda_version }} | ||
. | ||
|
||
- name: Run tests | ||
run: docker run | ||
--rm | ||
--net host | ||
--pid host | ||
--shm-size 64G | ||
--env USE_CUDA="1" | ||
--volume $HOME/.cache/huggingface:/home/user/.cache/huggingface | ||
--volume $(pwd):/workspace/optimum-benchmark | ||
--workdir /workspace/optimum-benchmark | ||
--gpus '"device=0,1"' | ||
--entrypoint /bin/bash | ||
opt-bench-cuda:${{ matrix.image.cuda_version }} | ||
-c "pip install -e .[testing,timm,diffusers] && pytest -k 'api and cuda' -x" |
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,32 @@ | ||
name: API Misc Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
run_api_misc_tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install requirements | ||
run: | | ||
pip install --upgrade pip | ||
pip install -e .[testing,timm,diffusers] | ||
- name: Run tests | ||
run: pytest -k "api and not (cpu or cuda or rocm or tensorrt)" |
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,56 @@ | ||
name: API ROCm Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build_image_and_run_api_rocm_tests: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
image: | ||
[ | ||
{ torch_rocm: rocm5.6, torch_pre_release: 0, rocm_version: 5.6.1 }, | ||
{ torch_rocm: rocm5.7, torch_pre_release: 1, rocm_version: 5.7 }, | ||
] | ||
|
||
runs-on: hf-amd-mi210-dev | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build image | ||
run: docker build | ||
--file docker/rocm.dockerfile | ||
--build-arg USER_ID=$(id -u) | ||
--build-arg GROUP_ID=$(id -g) | ||
--build-arg TORCH_ROCM=${{ matrix.image.torch_rocm }} | ||
--build-arg TORCH_PRE_RELEASE=${{ matrix.image.torch_pre_release }} | ||
--build-arg ROCM_VERSION=${{ matrix.image.rocm_version }} | ||
--tag opt-bench-rocm:${{ matrix.image.rocm_version }} | ||
. | ||
|
||
- name: Run tests | ||
run: docker run | ||
--rm | ||
--net host | ||
--pid host | ||
--shm-size 64G | ||
--env USE_ROCM="1" | ||
--volume $HOME/.cache/huggingface:/home/user/.cache/huggingface | ||
--volume $(pwd):/workspace/optimum-benchmark | ||
--workdir /workspace/optimum-benchmark | ||
--device /dev/kfd | ||
--device /dev/dri/renderD128 | ||
--device /dev/dri/renderD129 | ||
--entrypoint /bin/bash | ||
opt-bench-rocm:${{ matrix.image.rocm_version }} | ||
-c "pip install -e .[testing,timm,diffusers] && pytest -k 'api and cuda' -x" |
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
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
Oops, something went wrong.