Skip to content

Commit

Permalink
added workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Feb 22, 2024
1 parent 3fa635e commit ed43a9e
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check_quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
python-version: "3.10"

- name: Install quality requirements
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_api_cpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
python-version: "3.10"

- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_api_misc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
python-version: "3.10"

- name: Install requirements
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test_cli_cpu_neural_compressor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
python-version: "3.10"

- name: Install Intel Neural Compressor CPU requirements
- name: Install requirements
run: |
pip install --upgrade pip
pip install -e .[testing,neural-compressor,diffusers,timm]
- name: Run Intel Neural Compressor CPU tests
- name: Run CPU tests
run: pytest -k "cli and cpu and neural_compressor"
5 changes: 2 additions & 3 deletions .github/workflows/test_cli_cpu_onnxruntime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ jobs:
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
python-version: "3.10"

- name: Install requirements
run: |
pip install --upgrade pip
pip install -e .[testing,onnxruntime,diffusers,timm]
- name: Run tests
run: |
pytest -k "cli and cpu and onnxruntime"
run: pytest -k "cli and cpu and onnxruntime"
5 changes: 2 additions & 3 deletions .github/workflows/test_cli_cpu_openvino.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ jobs:
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
python-version: "3.10"

- name: Install requirements
run: |
pip install --upgrade pip
pip install -e .[testing,openvino,diffusers,timm]
- name: Run tests
run: |
pytest -k "cli and cpu and openvino"
run: pytest -k "cli and cpu and openvino"
32 changes: 32 additions & 0 deletions .github/workflows/test_cli_cpu_py_tgi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CLI CPU Py-TGI 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_cli_cpu_py_tgi_tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install requirements
run: |
pip install --upgrade pip
pip install -e .[testing,py-tgi]
- name: Run tests
run: pytest -k "cli and cpu and py_tgi"
5 changes: 2 additions & 3 deletions .github/workflows/test_cli_cpu_pytorch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ jobs:
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
python-version: "3.10"

- name: Install requirements
run: |
pip install --upgrade pip
pip install -e .[testing,diffusers,timm,peft]
- name: Run tests
run: |
pytest -k "cli and cpu and pytorch"
run: pytest -k "cli and cpu and pytorch"
2 changes: 1 addition & 1 deletion .github/workflows/test_cli_misc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
python-version: "3.10"

- name: Install requirements
run: |
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/test_cli_tensorrt_onnxruntime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,20 @@ jobs:
--tag opt-bench-tensorrt:latest
.

- name: Get GPUs with most free memory
id: get_devices
run: |
echo "::set-output name=devices::$(nvidia-smi --query-gpu=memory.free,index --format=csv,noheader,nounits | sort -n -k1 | tail -n 2 | awk -F', ' '{print $2}' | xargs echo -n | sed 's/ /,/g' | awk '{print $0}')"
- name: Run tests
run: docker run
--rm
--pid host
--shm-size 64G
--env USE_CUDA="1"
--gpus '"device=${{ steps.get_devices.outputs.devices }}"'
--volume $(pwd):/workspace/optimum-benchmark
--workdir /workspace/optimum-benchmark
--gpus '"device=0,1"'
--entrypoint /bin/bash
opt-bench-tensorrt:latest
-c "pip install -e .[testing,onnxruntime-gpu,diffusers,timm] && pytest -k 'cli and tensorrt and onnxruntime' -x"
1 change: 1 addition & 0 deletions tests/configs/_gpt_sweep_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ hydra:
sweeper:
params:
backend.task: text-generation
backend.no_weights: true,false
backend.model: hf-internal-testing/tiny-random-gpt2,IlyasMoutawwakil/tiny-random-llama
8 changes: 6 additions & 2 deletions tests/configs/_inference_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ defaults:
- benchmark: inference

benchmark:
memory: true
latency: true

duration: 1
warmup_runs: 1
new_tokens: 2
memory: true
generate_kwargs:
max_new_tokens: 5
min_new_tokens: 5
6 changes: 4 additions & 2 deletions tests/configs/_timm_.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
backend:
library: timm
task: image-classification
model: timm/tiny_vit_21m_224.in1k

hydra:
sweeper:
params:
backend.no_weights: true,false
3 changes: 2 additions & 1 deletion tests/configs/cuda_training_pytorch_gpt_naive_mp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ defaults:
# order of inheritance, last one overrides previous ones
- _base_ # inherits from base config
- _training_ # inherits from training config
- _gpt_naive_mp_ # inherits from lm naive mp config
- _naive_mp_ # inherits from lm naive mp config
- _gpt_ # inherits from gpt config
- _cuda_ # inherits from cpu config
- _self_ # hydra 1.1 compatibility

Expand Down

0 comments on commit ed43a9e

Please sign in to comment.