Skip to content

Commit 1bb63a4

Browse files
Make all tests separate
Signed-off-by: Keval Morabia <[email protected]>
1 parent 2848404 commit 1bb63a4

File tree

2 files changed

+35
-40
lines changed

2 files changed

+35
-40
lines changed

.github/workflows/_example_tests_runner.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88
description: "Docker image to use for tests"
99
required: true
1010
type: string
11-
examples:
12-
description: "Space-separated list of example names to test"
11+
example:
12+
description: "Example name to test (e.g. 'llm_ptq')"
1313
required: true
1414
type: string
1515
timeout_minutes:
@@ -18,7 +18,7 @@ on:
1818
type: number
1919
default: 60
2020
pip_install_extras:
21-
description: 'Pip install extras (e.g., "[hf,dev-test]" or "[all,dev-test]")'
21+
description: "Pip install extras (e.g. '[hf,dev-test]' or '[all,dev-test]')"
2222
required: false
2323
type: string
2424
default: "[all,dev-test]"
@@ -29,7 +29,7 @@ on:
2929
default: "linux-amd64-gpu-h100-latest-1"
3030

3131
jobs:
32-
run-tests:
32+
run-test:
3333
runs-on: ${{ inputs.runner }}
3434
timeout-minutes: ${{ inputs.timeout_minutes }}
3535
container:
@@ -52,17 +52,13 @@ jobs:
5252
5353
pip install ".${{ inputs.pip_install_extras }}"
5454
55-
if [[ "${{ inputs.examples }}" == *"diffusers"* ]]; then
55+
if [[ "${{ inputs.example }}" == *"diffusers"* ]]; then
5656
echo "Uninstalling apex for diffusers: T5 Int8 (PixArt) + Apex is not supported as per https://github.com/huggingface/transformers/issues/21391"
5757
pip uninstall -y apex || true
5858
fi
5959
60-
for example in ${{ inputs.examples }}; do
61-
find examples/$example -name "requirements.txt" | while read req_file; do pip install -r "$req_file" || exit 1; done
62-
done
60+
find examples/${{ inputs.example }} -name "requirements.txt" | while read req_file; do pip install -r "$req_file" || exit 1; done
6361
- name: Run tests
6462
run: |
65-
TEST_DIRS=""
66-
for example in ${{ inputs.examples }}; do TEST_DIRS="$TEST_DIRS tests/examples/$example"; done
67-
echo "Running tests in: $TEST_DIRS"
68-
pytest $TEST_DIRS
63+
echo "Running tests for: ${{ inputs.example }}"
64+
pytest tests/examples/${{ inputs.example }}

.github/workflows/example_tests.yml

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,6 @@ on:
77
schedule:
88
- cron: "0 0 * * *" # Nightly
99
workflow_dispatch: # On-demand
10-
inputs:
11-
torch_examples:
12-
description: "PyTorch examples to test (space-separated, empty to skip)"
13-
type: string
14-
default: ""
15-
trtllm_examples:
16-
description: "TensorRT-LLM examples to test (space-separated, empty to skip)"
17-
type: string
18-
default: "llm_ptq vlm_ptq"
19-
onnx_examples:
20-
description: "ONNX/TensorRT examples to test (space-separated, empty to skip)"
21-
type: string
22-
default: "diffusers"
2310

2411
# Cancel previous runs if new commit is pushed to the same PR
2512
concurrency:
@@ -73,71 +60,83 @@ jobs:
7360
example-torch-pr:
7461
needs: [check-file-changes, wait-checks]
7562
if: startsWith(github.ref, 'refs/heads/pull-request/') && needs.check-file-changes.outputs.any_changed == 'true'
63+
strategy:
64+
matrix:
65+
example: [llm_distill, llm_qat, llm_sparsity, speculative_decoding]
7666
uses: ./.github/workflows/_example_tests_runner.yml
7767
secrets: inherit
7868
with:
7969
docker_image: "nvcr.io/nvidia/pytorch:25.06-py3"
80-
examples: "llm_distill llm_qat llm_sparsity speculative_decoding"
81-
timeout_minutes: 60
70+
example: ${{ matrix.example }}
8271
pip_install_extras: "[hf,dev-test]"
8372
runner: linux-amd64-gpu-l4-latest-1
8473

8574
example-torch-non-pr:
86-
if: ${{ !startsWith(github.ref, 'refs/heads/pull-request/') && (github.event_name != 'workflow_dispatch' || inputs.torch_examples != '') }}
75+
if: ${{ !startsWith(github.ref, 'refs/heads/pull-request/') }}
76+
strategy:
77+
matrix:
78+
example: [llm_distill, llm_qat, llm_sparsity, speculative_decoding]
8779
uses: ./.github/workflows/_example_tests_runner.yml
8880
secrets: inherit
8981
with:
9082
docker_image: "nvcr.io/nvidia/pytorch:25.06-py3"
91-
examples: ${{ inputs.torch_examples || 'llm_distill llm_qat llm_sparsity speculative_decoding' }}
92-
timeout_minutes: 60
83+
example: ${{ matrix.example }}
9384
pip_install_extras: "[hf,dev-test]"
9485
runner: linux-amd64-gpu-h100-latest-2
9586

9687
##### TensorRT-LLM Example Tests #####
9788
example-trtllm-pr:
9889
needs: [check-file-changes, wait-checks]
9990
if: startsWith(github.ref, 'refs/heads/pull-request/') && needs.check-file-changes.outputs.any_changed == 'true'
91+
strategy:
92+
matrix:
93+
example: [llm_ptq, vlm_ptq]
10094
uses: ./.github/workflows/_example_tests_runner.yml
10195
secrets: inherit
10296
with:
10397
docker_image: "nvcr.io/nvidia/tensorrt-llm/release:1.1.0rc2.post2"
104-
examples: "llm_autodeploy llm_eval llm_ptq vlm_ptq"
105-
timeout_minutes: 90
98+
example: ${{ matrix.example }}
10699
pip_install_extras: "[hf,dev-test]"
107100
runner: linux-amd64-gpu-h100-latest-1
108101

109102
example-trtllm-non-pr:
110-
if: ${{ !startsWith(github.ref, 'refs/heads/pull-request/') && (github.event_name != 'workflow_dispatch' || inputs.trtllm_examples != '') }}
103+
if: ${{ !startsWith(github.ref, 'refs/heads/pull-request/') }}
104+
strategy:
105+
matrix:
106+
example: [llm_autodeploy, llm_eval, llm_ptq, vlm_ptq]
111107
uses: ./.github/workflows/_example_tests_runner.yml
112108
secrets: inherit
113109
with:
114110
docker_image: "nvcr.io/nvidia/tensorrt-llm/release:1.1.0rc2.post2"
115-
examples: ${{ inputs.trtllm_examples || 'llm_autodeploy llm_eval llm_ptq vlm_ptq' }}
116-
timeout_minutes: 90
111+
example: ${{ matrix.example }}
117112
pip_install_extras: "[hf,dev-test]"
118113
runner: linux-amd64-gpu-h100-latest-2
119114

120115
##### ONNX/TensorRT Example Tests #####
121116
example-onnx-pr:
122117
needs: [check-file-changes, wait-checks]
123118
if: startsWith(github.ref, 'refs/heads/pull-request/') && needs.check-file-changes.outputs.any_changed == 'true'
119+
strategy:
120+
matrix:
121+
example: [diffusers, onnx_ptq]
124122
uses: ./.github/workflows/_example_tests_runner.yml
125123
secrets: inherit
126124
with:
127125
docker_image: "nvcr.io/nvidia/tensorrt:25.08-py3"
128-
examples: "diffusers onnx_ptq"
129-
timeout_minutes: 60
126+
example: ${{ matrix.example }}
130127
pip_install_extras: "[all,dev-test]"
131128
runner: linux-amd64-gpu-l4-latest-1
132129

133130
example-onnx-non-pr:
134-
if: ${{ !startsWith(github.ref, 'refs/heads/pull-request/') && (github.event_name != 'workflow_dispatch' || inputs.onnx_examples != '') }}
131+
if: ${{ !startsWith(github.ref, 'refs/heads/pull-request/') }}
132+
strategy:
133+
matrix:
134+
example: [diffusers, onnx_ptq]
135135
uses: ./.github/workflows/_example_tests_runner.yml
136136
secrets: inherit
137137
with:
138138
docker_image: "nvcr.io/nvidia/tensorrt:25.08-py3"
139-
examples: ${{ inputs.onnx_examples || 'diffusers onnx_ptq' }}
140-
timeout_minutes: 60
139+
example: ${{ matrix.example }}
141140
pip_install_extras: "[all,dev-test]"
142141
runner: linux-amd64-gpu-l4-latest-1
143142

0 commit comments

Comments
 (0)