Skip to content

Commit 92bf087

Browse files
Merge branch 'main' into sasha_reasoning_test
2 parents 2dd3a2d + 50c063b commit 92bf087

33 files changed

Lines changed: 5418 additions & 496 deletions

.github/workflows/quality.yaml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ concurrency:
1212
cancel-in-progress: true
1313
group: ${{ github.workflow }}-${{ github.ref }}
1414

15+
env:
16+
UV_SYSTEM_PYTHON: 1
17+
UV_TORCH_BACKEND: auto
18+
1519
jobs:
1620
quality:
1721
runs-on: ubuntu-latest
@@ -20,18 +24,9 @@ jobs:
2024
- name: Checkout
2125
uses: actions/checkout@v4
2226

23-
- name: Set up Python 3.10
24-
uses: actions/setup-python@v5
25-
with:
26-
python-version: "3.10"
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v6
2729

28-
- name: Install quality requirements
30+
- name: Run quality checks
2931
run: |
30-
pip install uv
31-
uv pip install --upgrade pip
32-
uv pip install ruff
33-
env:
34-
UV_SYSTEM_PYTHON: 1
35-
36-
- name: Check style
37-
run: make quality
32+
make quality

.github/workflows/test_api_cpu.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ concurrency:
1919
cancel-in-progress: true
2020
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2121

22+
env:
23+
UV_SYSTEM_PYTHON: 1
24+
UV_TORCH_BACKEND: auto
25+
2226
jobs:
2327
run_api_cpu_tests:
2428
if: ${{
@@ -35,23 +39,19 @@ jobs:
3539
- name: Checkout
3640
uses: actions/checkout@v4
3741

38-
- name: Set up Python 3.10
39-
uses: actions/setup-python@v5
40-
with:
41-
python-version: "3.10"
42+
- name: Install uv
43+
uses: astral-sh/setup-uv@v6
4244

43-
- name: Install dependencies
45+
- name: Run tests
4446
run: |
45-
pip install uv
46-
uv pip install --upgrade pip
47-
uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
48-
uv pip install -e .[testing,timm,diffusers,codecarbon]
47+
make test-api-cpu
4948
env:
50-
UV_SYSTEM_PYTHON: 1
49+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
50+
PUSH_REPO_ID: optimum-benchmark/cpu
5151

52-
- name: Run tests
52+
- name: Run examples
5353
run: |
54-
pytest tests/test_api.py -s -k "api and cpu"
54+
make test-api-cpu-examples
5555
env:
5656
HF_TOKEN: ${{ secrets.HF_TOKEN }}
5757
PUSH_REPO_ID: optimum-benchmark/cpu

.github/workflows/test_api_cuda.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ concurrency:
1919
cancel-in-progress: true
2020
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2121

22+
env:
23+
UV_SYSTEM_PYTHON: 1
24+
UV_TORCH_BACKEND: auto
25+
2226
jobs:
2327
run_api_cuda_tests:
2428
if: ${{
@@ -32,29 +36,23 @@ jobs:
3236
runs-on:
3337
group: aws-g5-4xlarge-plus
3438

35-
container:
36-
image: ghcr.io/huggingface/optimum-benchmark:latest-cuda
37-
options: --ipc host --gpus all
38-
3939
steps:
4040
- name: Checkout
4141
uses: actions/checkout@v4
4242

43-
- name: Install dependencies
44-
run: |
45-
pip install -e .[testing,timm,diffusers,codecarbon]
43+
- name: Install uv
44+
uses: astral-sh/setup-uv@v6
4645

4746
- name: Run tests
4847
run: |
49-
pytest tests/test_api.py -x -s -k "api and cuda"
48+
make test-api-cuda
5049
env:
5150
HF_TOKEN: ${{ secrets.HF_TOKEN }}
5251
PUSH_REPO_ID: optimum-benchmark/cuda
5352

5453
- name: Run examples
5554
run: |
56-
pip install -e .[testing,torchao,gptqmodel]
57-
pytest tests/test_examples.py -x -s -k "api and cuda"
55+
make test-api-cuda-examples
5856
env:
5957
HF_TOKEN: ${{ secrets.HF_TOKEN }}
6058
PUSH_REPO_ID: optimum-benchmark/cuda

.github/workflows/test_api_misc.yaml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ concurrency:
1919
cancel-in-progress: true
2020
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2121

22+
env:
23+
UV_SYSTEM_PYTHON: 1
24+
UV_TORCH_BACKEND: auto
25+
2226
jobs:
2327
run_api_misc_tests:
2428
if: ${{
@@ -33,7 +37,7 @@ jobs:
3337
fail-fast: false
3438
matrix:
3539
os: [ubuntu-latest, "macos-latest", windows-latest]
36-
python: ["3.8", "3.12"]
40+
python: ["3.10", "3.12"]
3741

3842
name: API Misc Tests - OS ${{ matrix.os }} - Python ${{ matrix.python }}
3943

@@ -43,23 +47,14 @@ jobs:
4347
- name: Checkout
4448
uses: actions/checkout@v4
4549

46-
- name: Set up Python ${{ matrix.python }}
47-
uses: actions/setup-python@v5
50+
- name: Install uv
51+
uses: astral-sh/setup-uv@v6
4852
with:
4953
python-version: ${{ matrix.python }}
5054

51-
- name: Install requirements
52-
run: |
53-
pip install uv
54-
uv pip install --upgrade pip
55-
uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
56-
uv pip install -e .[testing,timm,diffusers,codecarbon]
57-
env:
58-
UV_SYSTEM_PYTHON: 1
59-
6055
- name: Run tests
6156
run: |
62-
pytest tests/test_api.py -s -k "api and not (cpu or cuda or rocm or mps)"
57+
make test-api-misc
6358
env:
6459
HF_TOKEN: ${{ secrets.HF_TOKEN }}
6560
PUSH_REPO_ID: optimum-benchmark/misc-${{ matrix.os }}-${{ matrix.python }}

.github/workflows/test_cli_cpu_ipex.yaml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ concurrency:
1919
cancel-in-progress: true
2020
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2121

22+
env:
23+
UV_SYSTEM_PYTHON: 1
24+
UV_TORCH_BACKEND: auto
25+
2226
jobs:
2327
run_cli_cpu_ipex_tests:
2428
if: ${{
@@ -36,22 +40,13 @@ jobs:
3640
- name: Checkout
3741
uses: actions/checkout@v4
3842

39-
- name: Set up Python 3.10
40-
uses: actions/setup-python@v5
41-
with:
42-
python-version: "3.10"
43-
44-
- name: Install requirements
45-
run: |
46-
pip install uv
47-
uv pip install --upgrade pip
48-
uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
49-
uv pip install -e .[testing,ipex,diffusers,timm]
50-
env:
51-
UV_SYSTEM_PYTHON: 1
43+
- name: Install uv
44+
uses: astral-sh/setup-uv@v6
5245

5346
- name: Run tests
54-
run: pytest tests/test_cli.py -s -k "cli and cpu and ipex"
47+
run: |
48+
make test-cli-cpu-ipex
5549
5650
- name: Run examples
57-
run: pytest tests/test_examples.py -s -k "cli and cpu and ipex"
51+
run: |
52+
make test-cli-cpu-ipex-examples

.github/workflows/test_cli_cpu_llama_cpp.yaml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ concurrency:
1919
cancel-in-progress: true
2020
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2121

22+
env:
23+
UV_SYSTEM_PYTHON: 1
24+
UV_TORCH_BACKEND: auto
25+
2226
jobs:
2327
run_cli_cpu_llama_cpp_tests:
2428
if: ${{
@@ -36,22 +40,13 @@ jobs:
3640
- name: Checkout
3741
uses: actions/checkout@v4
3842

39-
- name: Set up Python 3.10
40-
uses: actions/setup-python@v5
41-
with:
42-
python-version: "3.10"
43-
44-
- name: Install requirements
45-
run: |
46-
pip install uv
47-
uv pip install --upgrade pip
48-
uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
49-
uv pip install -e .[testing,llama-cpp]
50-
env:
51-
UV_SYSTEM_PYTHON: 1
43+
- name: Install uv
44+
uses: astral-sh/setup-uv@v6
5245

5346
- name: Run tests
54-
run: pytest tests/test_cli.py -s -k "cli and cpu and llama_cpp"
47+
run: |
48+
make test-cli-cpu-llama-cpp
5549
5650
- name: Run examples
57-
run: pytest tests/test_examples.py -s -k "cli and cpu and llama_cpp"
51+
run: |
52+
make test-cli-cpu-llama-cpp-examples

.github/workflows/test_cli_cpu_onnxruntime.yaml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ concurrency:
1919
cancel-in-progress: true
2020
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2121

22+
env:
23+
UV_SYSTEM_PYTHON: 1
24+
UV_TORCH_BACKEND: auto
25+
2226
jobs:
2327
run_cli_cpu_onnxruntime_tests:
2428
if: ${{
@@ -36,22 +40,13 @@ jobs:
3640
- name: Checkout
3741
uses: actions/checkout@v4
3842

39-
- name: Set up Python 3.10
40-
uses: actions/setup-python@v5
41-
with:
42-
python-version: "3.10"
43-
44-
- name: Install requirements
45-
run: |
46-
pip install uv
47-
uv pip install --upgrade pip
48-
uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
49-
uv pip install -e .[testing,onnxruntime,diffusers,timm]
50-
env:
51-
UV_SYSTEM_PYTHON: 1
43+
- name: Install uv
44+
uses: astral-sh/setup-uv@v6
5245

5346
- name: Run tests
54-
run: pytest tests/test_cli.py -s -k "cli and cpu and onnxruntime"
47+
run: |
48+
make test-cli-cpu-onnxruntime
5549
5650
- name: Run examples
57-
run: pytest tests/test_examples.py -s -k "cli and cpu and onnxruntime"
51+
run: |
52+
make test-cli-cpu-onnxruntime-examples

.github/workflows/test_cli_cpu_openvino.yaml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ concurrency:
1919
cancel-in-progress: true
2020
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2121

22+
env:
23+
UV_SYSTEM_PYTHON: 1
24+
UV_TORCH_BACKEND: auto
25+
2226
jobs:
2327
run_cli_cpu_openvino_tests:
2428
if: ${{
@@ -36,22 +40,13 @@ jobs:
3640
- name: Checkout
3741
uses: actions/checkout@v4
3842

39-
- name: Set up Python 3.10
40-
uses: actions/setup-python@v5
41-
with:
42-
python-version: "3.10"
43-
44-
- name: Install requirements
45-
run: |
46-
pip install uv
47-
uv pip install --upgrade pip
48-
uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
49-
uv pip install -e .[testing,openvino,diffusers,timm]
50-
env:
51-
UV_SYSTEM_PYTHON: 1
43+
- name: Install uv
44+
uses: astral-sh/setup-uv@v6
5245

5346
- name: Run tests
54-
run: pytest tests/test_cli.py -s -k "cli and cpu and openvino"
47+
run: |
48+
make test-cli-cpu-openvino
5549
5650
- name: Run examples
57-
run: pytest tests/test_examples.py -s -k "cli and cpu and openvino"
51+
run: |
52+
make test-cli-cpu-openvino-examples

.github/workflows/test_cli_cpu_py_txi.yaml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ concurrency:
1919
cancel-in-progress: true
2020
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2121

22+
env:
23+
UV_SYSTEM_PYTHON: 1
24+
UV_TORCH_BACKEND: auto
25+
2226
jobs:
2327
run_cli_cpu_py_txi_tests:
2428
if: ${{
@@ -36,19 +40,13 @@ jobs:
3640
- name: Checkout
3741
uses: actions/checkout@v4
3842

39-
- name: Set up Python 3.10
40-
uses: actions/setup-python@v5
41-
with:
42-
python-version: "3.10"
43+
- name: Install uv
44+
uses: astral-sh/setup-uv@v6
4345

44-
- name: Install requirements
46+
- name: Run tests
4547
run: |
46-
pip install uv
47-
uv pip install --upgrade pip
48-
uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
49-
uv pip install -e .[testing,py-txi]
50-
env:
51-
UV_SYSTEM_PYTHON: 1
48+
make test-cli-cpu-py-txi
5249
53-
- name: Run tests
54-
run: pytest tests/test_cli.py -s -k "cli and cpu and py_txi"
50+
- name: Run examples
51+
run: |
52+
make test-cli-cpu-py-txi-examples

0 commit comments

Comments
 (0)