Skip to content

Commit

Permalink
Labeling system in CI (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil authored Sep 21, 2024
1 parent a2f76ce commit 90b9d6a
Show file tree
Hide file tree
Showing 30 changed files with 613 additions and 646 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/test_api_cpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,30 @@ on:
push:
branches:
- main
paths:
- .github/workflows/test_api_cpu.yaml
- "optimum_benchmark/**"
- "docker/**"
- "tests/**"
- "setup.py"
pull_request:
branches:
- main
paths:
- .github/workflows/test_api_cpu.yaml
- "optimum_benchmark/**"
- "docker/**"
- "tests/**"
- "setup.py"
types:
- opened
- reopened
- synchronize
- labeled
- unlabeled

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

jobs:
run_api_cpu_tests:
if: ${{
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
contains( github.event.pull_request.labels.*.name, 'api') ||
contains( github.event.pull_request.labels.*.name, 'cpu') ||
contains( github.event.pull_request.labels.*.name, 'api_cpu')
}}

runs-on: ubuntu-latest

steps:
Expand Down
54 changes: 24 additions & 30 deletions .github/workflows/test_api_cuda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,47 @@ on:
push:
branches:
- main
paths:
- .github/workflows/test_api_cuda.yaml
- "optimum_benchmark/**"
- "docker/**"
- "tests/**"
- "setup.py"
pull_request:
branches:
- main
paths:
- .github/workflows/test_api_cuda.yaml
- "optimum_benchmark/**"
- "docker/**"
- "tests/**"
- "setup.py"
types:
- opened
- reopened
- synchronize
- labeled
- unlabeled

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

env:
IMAGE: ghcr.io/huggingface/optimum-benchmark:latest-cuda

jobs:
run_api_cuda_tests:
if: ${{
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
contains( github.event.pull_request.labels.*.name, 'api') ||
contains( github.event.pull_request.labels.*.name, 'cuda') ||
contains( github.event.pull_request.labels.*.name, 'api_cuda')
}}

runs-on: [single-gpu, nvidia-gpu, a10, ci]

container:
image: ghcr.io/huggingface/optimum-benchmark:latest-cuda
options: --gpus all --volume /mnt/cache/.cache/huggingface:/mnt/cache/

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: |
pip install -e .[testing,timm,diffusers,codecarbon]
- name: Run tests
uses: addnab/docker-run-action@v3
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
PUSH_REPO_ID: optimum-benchmark/cuda
with:
image: ${{ env.IMAGE }}
options: |
--rm
--gpus all
--shm-size 64G
--env HF_TOKEN
--env PUSH_REPO_ID
--env MKL_THREADING_LAYER=GNU
--volume ${{ github.workspace }}:/workspace
--workdir /workspace
run: |
pip install -e .[testing,timm,diffusers,codecarbon]
pytest -s -x -k "api and cuda"
run: |
pytest -s -x -k "api and cuda"
42 changes: 26 additions & 16 deletions .github/workflows/test_api_misc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,48 @@ on:
push:
branches:
- main
paths:
- .github/workflows/test_api_misc.yaml
- "optimum_benchmark/**"
- "docker/**"
- "tests/**"
- "setup.py"
pull_request:
branches:
- main
paths:
- .github/workflows/test_api_misc.yaml
- "optimum_benchmark/**"
- "docker/**"
- "tests/**"
- "setup.py"
types:
- opened
- reopened
- synchronize
- labeled
- unlabeled

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

jobs:
run_api_misc_tests:
runs-on: ubuntu-latest
if: ${{
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
contains( github.event.pull_request.labels.*.name, 'api') ||
contains( github.event.pull_request.labels.*.name, 'misc') ||
contains( github.event.pull_request.labels.*.name, 'api_misc')
}}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, "macos-latest", windows-latest]
python: ["3.8", "3.12"]

name: OS ${{ matrix.os }} - Python ${{ matrix.python }}

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python 3.10
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: ${{ matrix.python }}

- name: Install requirements
run: |
Expand All @@ -47,6 +57,6 @@ jobs:
- name: Run tests
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
PUSH_REPO_ID: optimum-benchmark/misc
PUSH_REPO_ID: optimum-benchmark/misc-${{ matrix.os }}-${{ matrix.python }}
run: |
pytest -s -k "api and not (cpu or cuda or rocm or mps)"
26 changes: 14 additions & 12 deletions .github/workflows/test_api_rocm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,30 @@ on:
push:
branches:
- main
paths:
- .github/workflows/test_api_rocm.yaml
- "optimum_benchmark/**"
- "docker/**"
- "tests/**"
- "setup.py"
pull_request:
branches:
- main
paths:
- .github/workflows/test_api_rocm.yaml
- "optimum_benchmark/**"
- "docker/**"
- "tests/**"
- "setup.py"
types:
- opened
- reopened
- synchronize
- labeled
- unlabeled

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

jobs:
run_api_rocm_tests:
if: ${{
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
contains( github.event.pull_request.labels.*.name, 'api') ||
contains( github.event.pull_request.labels.*.name, 'rocm') ||
contains( github.event.pull_request.labels.*.name, 'api_rocm')
}}

runs-on: [self-hosted, amd-gpu, single-gpu]

container:
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/test_cli_cpu_ipex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,31 @@ on:
push:
branches:
- main
paths:
- .github/workflows/test_cli_cpu_ipex.yaml
- "optimum_benchmark/**"
- "docker/**"
- "tests/**"
- "setup.py"
pull_request:
branches:
- main
paths:
- .github/workflows/test_cli_cpu_ipex.yaml
- "optimum_benchmark/**"
- "docker/**"
- "tests/**"
- "setup.py"
types:
- opened
- reopened
- synchronize
- labeled
- unlabeled

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

jobs:
run_cli_cpu_ipex_tests:
if: ${{
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
contains( github.event.pull_request.labels.*.name, 'cli') ||
contains( github.event.pull_request.labels.*.name, 'cpu') ||
contains( github.event.pull_request.labels.*.name, 'ipex') ||
contains( github.event.pull_request.labels.*.name, 'cli_cpu_ipex')
}}

runs-on: ubuntu-latest

steps:
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/test_cli_cpu_llama_cpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,31 @@ on:
push:
branches:
- main
paths:
- .github/workflows/test_cli_llama_cpp.yaml
- "optimum_benchmark/**"
- "docker/**"
- "tests/**"
- "setup.py"
pull_request:
branches:
- main
paths:
- .github/workflows/test_cli_llama_cpp.yaml
- "optimum_benchmark/**"
- "docker/**"
- "tests/**"
- "setup.py"
types:
- opened
- reopened
- synchronize
- labeled
- unlabeled

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

jobs:
run_cli_cpu_llama_cpp_tests:
if: ${{
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
contains( github.event.pull_request.labels.*.name, 'cli') ||
contains( github.event.pull_request.labels.*.name, 'cpu') ||
contains( github.event.pull_request.labels.*.name, 'llama_cpp') ||
contains( github.event.pull_request.labels.*.name, 'cli_cpu_llama_cpp')
}}

runs-on: ubuntu-latest

steps:
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/test_cli_cpu_neural_compressor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,31 @@ on:
push:
branches:
- main
paths:
- .github/workflows/test_cli_cpu_neural_compressor.yaml
- "optimum_benchmark/**"
- "docker/**"
- "tests/**"
- "setup.py"
pull_request:
branches:
- main
paths:
- .github/workflows/test_cli_cpu_neural_compressor.yaml
- "optimum_benchmark/**"
- "docker/**"
- "tests/**"
- "setup.py"
types:
- opened
- reopened
- synchronize
- labeled
- unlabeled

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

jobs:
run_cli_cpu_neural_compressor_tests:
if: ${{
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
contains( github.event.pull_request.labels.*.name, 'cli') ||
contains( github.event.pull_request.labels.*.name, 'cpu') ||
contains( github.event.pull_request.labels.*.name, 'neural_compressor') ||
contains( github.event.pull_request.labels.*.name, 'cli_cpu_neural_compressor')
}}

runs-on: ubuntu-latest

steps:
Expand Down
Loading

0 comments on commit 90b9d6a

Please sign in to comment.