Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Dec 10, 2024
1 parent 2f37ba2 commit 0f0f289
Show file tree
Hide file tree
Showing 14 changed files with 84 additions and 23 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/test_api_cpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ jobs:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
PUSH_REPO_ID: optimum-benchmark/cpu

# - name: Run examples
# - if: ${{
# (github.event_name == 'push') ||
# (github.event_name == 'workflow_dispatch') ||
# contains( github.event.pull_request.labels.*.name, 'examples')
# }}
# name: Run examples
# run: |
# pytest tests/test_examples.py -s -k "api and cpu"
# env:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test_api_cuda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,14 @@ jobs:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
PUSH_REPO_ID: optimum-benchmark/cuda

- name: Run examples
- if: ${{
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
contains( github.event.pull_request.labels.*.name, 'examples')
}}
name: Run examples
run: |
pip install -e .[testing,torchao,autoawq,auto-gptq]
pytest tests/test_examples.py -x -s -k "api and cuda and pytorch"
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/test_cli_cpu_ipex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ jobs:

runs-on: ubuntu-latest

container:
image: ghcr.io/huggingface/optimum-benchmark:latest-cpu

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -46,5 +43,10 @@ jobs:
- name: Run tests
run: pytest tests/test_cli.py -s -k "cli and cpu and ipex"

# - name: Run examples
# - if: ${{
# (github.event_name == 'push') ||
# (github.event_name == 'workflow_dispatch') ||
# contains( github.event.pull_request.labels.*.name, 'examples')
# }}
# name: Run examples
# run: pytest tests/test_examples.py -s -k "cli and cpu and ipex"
7 changes: 6 additions & 1 deletion .github/workflows/test_cli_cpu_llama_cpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,10 @@ jobs:
- name: Run tests
run: pytest tests/test_cli.py -s -k "cli and cpu and llama_cpp"

- name: Run examples
- if: ${{
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
contains( github.event.pull_request.labels.*.name, 'examples')
}}
name: Run examples
run: pytest tests/test_examples.py -s -k "cli and cpu and llama_cpp"
7 changes: 6 additions & 1 deletion .github/workflows/test_cli_cpu_onnxruntime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,10 @@ jobs:
- name: Run tests
run: pytest tests/test_cli.py -s -k "cli and cpu and onnxruntime"

- name: Run examples
- if: ${{
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
contains( github.event.pull_request.labels.*.name, 'examples')
}}
name: Run examples
run: pytest tests/test_examples.py -s -k "cli and cpu and onnxruntime"
10 changes: 6 additions & 4 deletions .github/workflows/test_cli_cpu_openvino.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ jobs:

runs-on: ubuntu-latest

container:
image: ghcr.io/huggingface/optimum-benchmark:latest-cpu

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -47,5 +44,10 @@ jobs:
- name: Run tests
run: pytest tests/test_cli.py -s -k "cli and cpu and openvino"

# - name: Run examples
# - if: ${{
# (github.event_name == 'push') ||
# (github.event_name == 'workflow_dispatch') ||
# contains( github.event.pull_request.labels.*.name, 'examples')
# }}
# name: Run examples
# run: pytest tests/test_examples.py -s -k "cli and cpu and openvino"
9 changes: 7 additions & 2 deletions .github/workflows/test_cli_cpu_py_txi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,10 @@ jobs:
- name: Run tests
run: pytest tests/test_cli.py -s -k "cli and cpu and py_txi"

# - name: Run examples
# run: pytest tests/test_examples.py -s -k "cli and cpu and tgi"
# - if: ${{
# (github.event_name == 'push') ||
# (github.event_name == 'workflow_dispatch') ||
# contains( github.event.pull_request.labels.*.name, 'examples')
# }}
# name: Run examples
# run: pytest tests/test_examples.py -s -k "cli and cpu and (tgi or tei)"
7 changes: 6 additions & 1 deletion .github/workflows/test_cli_cpu_pytorch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,10 @@ jobs:
- name: Run tests
run: pytest tests/test_cli.py -s -k "cli and cpu and pytorch"

# - name: Run examples
# - if: ${{
# (github.event_name == 'push') ||
# (github.event_name == 'workflow_dispatch') ||
# contains( github.event.pull_request.labels.*.name, 'examples')
# }}
# name: Run examples
# run: pytest tests/test_examples.py -s -k "cli and cpu and pytorch"
7 changes: 6 additions & 1 deletion .github/workflows/test_cli_cuda_onnxruntime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,10 @@ jobs:
run: |
pytest tests/test_cli.py -x -s -k "cli and cuda and onnxruntime"
# - name: Run examples
# - if: ${{
# (github.event_name == 'push') ||
# (github.event_name == 'workflow_dispatch') ||
# contains( github.event.pull_request.labels.*.name, 'examples')
# }}
# name: Run examples
# run: pytest tests/test_examples.py -x -s -k "cli and cuda and onnxruntime"
9 changes: 7 additions & 2 deletions .github/workflows/test_cli_cuda_py_txi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,10 @@ jobs:
- name: Run tests
run: pytest tests/test_cli.py -x -s -k "cli and cuda and py_txi"

- name: Run examples
run: pytest tests/test_examples.py -x -s -k "cli and cuda and tgi"
- if: ${{
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
contains( github.event.pull_request.labels.*.name, 'examples')
}}
name: Run examples
run: pytest tests/test_examples.py -x -s -k "cli and cuda and (tgi or tei)"
7 changes: 6 additions & 1 deletion .github/workflows/test_cli_cuda_pytorch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ jobs:
run: |
pytest tests/test_cli.py -x -s -k "cli and cuda and pytorch and not (dp or ddp or device_map or deepspeed)"
- name: Run examples
- if: ${{
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
contains( github.event.pull_request.labels.*.name, 'examples')
}}
name: Run examples
run: pytest tests/test_examples.py -x -s -k "cli and cuda and pytorch"

run_cli_cuda_pytorch_multi_gpu_tests:
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/test_cli_cuda_tensorrt_llm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,16 @@ jobs:
run: |
pip install -e .[testing]
- name: Run tests
- name: Run tests (sequential)
run: |
pytest tests/test_cli.py -x -s -k "cli and cuda and tensorrt_llm and not (tp or pp)"
FORCE_SEQUENTIAL=1 pytest tests/test_cli.py -x -s -k "cli and cuda and tensorrt_llm and not (tp or pp)"
- name: Run examples
- if: ${{
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
contains( github.event.pull_request.labels.*.name, 'examples')
}}
name: Run examples
run: pytest tests/test_examples.py -x -s -k "cli and cuda and trt"

cli_cuda_tensorrt_llm_multi_gpu_tests:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/test_cli_cuda_vllm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ jobs:
run: |
FORCE_SEQUENTIAL=1 pytest tests/test_cli.py -x -s -k "cli and cuda and vllm and not (tp or pp)"
- name: Run examples
- if: ${{
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
contains( github.event.pull_request.labels.*.name, 'examples')
}}
name: Run examples
run: |
pytest tests/test_examples.py -x -s -k "cli and cuda and vllm"
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"py-txi": ["py-txi"],
"vllm": ["vllm"],
# optional dependencies
"torchao": ["torchao"],
"autoawq": ["autoawq"],
"auto-gptq": ["optimum", "auto-gptq"],
"sentence-transformers": ["sentence-transformers"],
Expand Down

0 comments on commit 0f0f289

Please sign in to comment.