Skip to content

Commit a4c2408

Browse files
Further unify pr and non-pr workflow jobs
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
1 parent 00998b9 commit a4c2408

File tree

3 files changed

+51
-100
lines changed

3 files changed

+51
-100
lines changed

.github/workflows/example_tests.yml

Lines changed: 24 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ jobs:
3030
tests/examples/**
3131
3232
##### PyTorch Example Tests (speculative_decoding requires 26.01 image) #####
33-
torch-pr:
33+
torch:
3434
needs: [pr-gate]
35-
if: startsWith(github.ref, 'refs/heads/pull-request/') && needs.pr-gate.outputs.any_changed == 'true'
36-
strategy: &torch_strategy
35+
if: >-
36+
needs.pr-gate.outputs.any_changed == 'true' ||
37+
!startsWith(github.ref, 'refs/heads/pull-request/')
38+
strategy:
3739
fail-fast: false
3840
matrix:
3941
example: [llm_distill, llm_qat, llm_sparsity, diffusers_sparsity]
@@ -47,21 +49,9 @@ jobs:
4749
example: ${{ matrix.example }}
4850
timeout_minutes: 30
4951
pip_install_extras: "[hf,dev-test]"
50-
runner: linux-amd64-gpu-rtxpro6000-latest-1
51-
52-
torch-non-pr:
53-
if: ${{ !startsWith(github.ref, 'refs/heads/pull-request/') }}
54-
strategy: *torch_strategy
55-
uses: ./.github/workflows/_example_tests_runner.yml
56-
secrets: inherit
57-
with:
58-
docker_image: "nvcr.io/nvidia/pytorch:${{ matrix.docker_image || '26.03' }}-py3"
59-
example: ${{ matrix.example }}
60-
timeout_minutes: 30
61-
pip_install_extras: "[hf,dev-test]"
62-
runner: linux-amd64-gpu-rtxpro6000-latest-2
52+
runner: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && 'linux-amd64-gpu-rtxpro6000-latest-1' || 'linux-amd64-gpu-rtxpro6000-latest-2' }}
6353

64-
##### TensorRT-LLM Example Tests #####
54+
##### TensorRT-LLM Example Tests (pr/non-pr split: non-pr runs extra autodeploy+eval examples) #####
6555
trtllm-pr:
6656
needs: [pr-gate]
6757
if: startsWith(github.ref, 'refs/heads/pull-request/') && needs.pr-gate.outputs.any_changed == 'true'
@@ -92,39 +82,27 @@ jobs:
9282
runner: linux-amd64-gpu-rtxpro6000-latest-2
9383

9484
##### Megatron Example Tests #####
95-
megatron-pr:
85+
megatron:
9686
needs: [pr-gate]
97-
if: startsWith(github.ref, 'refs/heads/pull-request/') && needs.pr-gate.outputs.any_changed == 'true'
98-
strategy: &nemo_strategy
99-
fail-fast: false
100-
matrix:
101-
example: [megatron_bridge]
102-
uses: ./.github/workflows/_example_tests_runner.yml
103-
secrets: inherit
104-
with:
105-
docker_image: "nvcr.io/nvidia/nemo:26.02"
106-
example: ${{ matrix.example }}
107-
timeout_minutes: 30
108-
pip_install_extras: "[hf,puzzletron,dev-test]"
109-
runner: linux-amd64-gpu-rtxpro6000-latest-1
110-
111-
megatron-non-pr:
112-
if: ${{ !startsWith(github.ref, 'refs/heads/pull-request/') }}
113-
strategy: *nemo_strategy
87+
if: >-
88+
needs.pr-gate.outputs.any_changed == 'true' ||
89+
!startsWith(github.ref, 'refs/heads/pull-request/')
11490
uses: ./.github/workflows/_example_tests_runner.yml
11591
secrets: inherit
11692
with:
11793
docker_image: "nvcr.io/nvidia/nemo:26.02"
118-
example: ${{ matrix.example }}
94+
example: megatron_bridge
11995
timeout_minutes: 30
12096
pip_install_extras: "[hf,puzzletron,dev-test]"
121-
runner: linux-amd64-gpu-rtxpro6000-latest-2
97+
runner: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && 'linux-amd64-gpu-rtxpro6000-latest-1' || 'linux-amd64-gpu-rtxpro6000-latest-2' }}
12298

12399
##### ONNX/TensorRT Example Tests #####
124-
onnx-pr:
100+
onnx:
125101
needs: [pr-gate]
126-
if: startsWith(github.ref, 'refs/heads/pull-request/') && needs.pr-gate.outputs.any_changed == 'true'
127-
strategy: &onnx_strategy
102+
if: >-
103+
needs.pr-gate.outputs.any_changed == 'true' ||
104+
!startsWith(github.ref, 'refs/heads/pull-request/')
105+
strategy:
128106
fail-fast: false
129107
matrix:
130108
example: [diffusers, torch_onnx]
@@ -134,33 +112,22 @@ jobs:
134112
docker_image: "nvcr.io/nvidia/tensorrt:26.02-py3"
135113
example: ${{ matrix.example }}
136114
pip_install_extras: "[onnx,hf,dev-test]"
137-
runner: linux-amd64-gpu-rtxpro6000-latest-1
138-
139-
onnx-non-pr:
140-
if: ${{ !startsWith(github.ref, 'refs/heads/pull-request/') }}
141-
strategy: *onnx_strategy
142-
uses: ./.github/workflows/_example_tests_runner.yml
143-
secrets: inherit
144-
with:
145-
docker_image: "nvcr.io/nvidia/tensorrt:26.02-py3"
146-
example: ${{ matrix.example }}
147-
pip_install_extras: "[onnx,hf,dev-test]"
148-
runner: linux-amd64-gpu-rtxpro6000-latest-2
115+
runner: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && 'linux-amd64-gpu-rtxpro6000-latest-1' || 'linux-amd64-gpu-rtxpro6000-latest-2' }}
149116

150117
##### Required Check for PR #####
151118
example-pr-required-check:
152119
# Run even if example tests are skipped
153120
if: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && always() }}
154-
needs: [pr-gate, torch-pr, trtllm-pr, megatron-pr, onnx-pr]
121+
needs: [pr-gate, torch, trtllm-pr, megatron, onnx]
155122
runs-on: ubuntu-latest
156123
steps:
157-
- name: Required GPU tests did not succeed
124+
- name: Required example tests did not succeed
158125
if: |
159126
needs.pr-gate.result != 'success' ||
160127
(needs.pr-gate.outputs.any_changed == 'true' && (
161-
needs.torch-pr.result != 'success' ||
128+
needs.torch.result != 'success' ||
162129
needs.trtllm-pr.result != 'success' ||
163-
needs.megatron-pr.result != 'success' ||
164-
needs.onnx-pr.result != 'success'
130+
needs.megatron.result != 'success' ||
131+
needs.onnx.result != 'success'
165132
))
166133
run: exit 1

.github/workflows/gpu_tests.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ jobs:
3030
tests/gpu/**
3131
tests/gpu_megatron/**
3232
tests/gpu_trtllm/**
33-
gpu-tests-pr:
33+
34+
gpu-tests:
3435
needs: [pr-gate]
35-
if: needs.pr-gate.outputs.any_changed == 'true'
36-
strategy: &gpu_strategy
36+
if: >-
37+
needs.pr-gate.outputs.any_changed == 'true' ||
38+
!startsWith(github.ref, 'refs/heads/pull-request/')
39+
strategy:
3740
fail-fast: false
3841
matrix:
3942
include:
@@ -47,15 +50,15 @@ jobs:
4750
- example: gpu_trtllm
4851
timeout: 30
4952
container_image: tensorrt-llm/release:1.3.0rc10
50-
runs-on: linux-amd64-gpu-rtxpro6000-latest-1
53+
runs-on: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && 'linux-amd64-gpu-rtxpro6000-latest-1' || 'linux-amd64-gpu-rtxpro6000-latest-2' }}
5154
timeout-minutes: ${{ matrix.timeout }}
52-
container: &gpu_container
55+
container:
5356
image: nvcr.io/nvidia/${{ matrix.container_image }}
5457
env:
5558
GIT_DEPTH: 1000 # For correct version
5659
PIP_CONSTRAINT: "" # Disable pip constraint for upgrading packages
5760
HF_TOKEN: ${{ secrets.HF_TOKEN }}
58-
steps: &gpu_steps
61+
steps:
5962
- uses: actions/checkout@v6
6063
- uses: nv-gha-runners/setup-proxy-cache@main
6164
- name: Setup environment variables
@@ -75,19 +78,13 @@ jobs:
7578
flags: gpu
7679
fail_ci_if_error: false # test may be skipped if relevant file changes are not detected
7780
verbose: true
78-
gpu-tests-non-pr:
79-
if: ${{ !startsWith(github.ref, 'refs/heads/pull-request/') }}
80-
strategy: *gpu_strategy
81-
runs-on: linux-amd64-gpu-rtxpro6000-latest-2
82-
timeout-minutes: ${{ matrix.timeout }}
83-
container: *gpu_container
84-
steps: *gpu_steps
81+
8582
gpu-pr-required-check:
86-
# Run even if gpu-tests-pr is skipped
83+
# Run even if gpu-tests is skipped
8784
if: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && always() }}
88-
needs: [pr-gate, gpu-tests-pr]
85+
needs: [pr-gate, gpu-tests]
8986
runs-on: ubuntu-latest
9087
steps:
9188
- name: Required GPU tests did not succeed
92-
if: ${{ needs.pr-gate.result != 'success' || (needs.pr-gate.outputs.any_changed == 'true' && needs.gpu-tests-pr.result != 'success') }}
89+
if: ${{ needs.pr-gate.result != 'success' || (needs.pr-gate.outputs.any_changed == 'true' && needs.gpu-tests.result != 'success') }}
9390
run: exit 1

.github/workflows/regression_tests.yml

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,20 @@ jobs:
3232
examples/dataset/**
3333
modelopt_recipes/general/speculative_decoding/**
3434
tools/launcher/**
35-
regression-tests-pr:
35+
36+
regression-tests:
3637
needs: [pr-gate]
37-
if: needs.pr-gate.outputs.any_changed == 'true'
38-
strategy: &regression_strategy
39-
fail-fast: false
40-
matrix:
41-
include:
42-
- example: regression
43-
timeout: 15
44-
container_image: pytorch:26.01-py3
45-
runs-on: linux-amd64-gpu-rtxpro6000-latest-1
46-
timeout-minutes: ${{ matrix.timeout }}
47-
container: &regression_container
48-
image: nvcr.io/nvidia/${{ matrix.container_image }}
38+
if: >-
39+
needs.pr-gate.outputs.any_changed == 'true' || !startsWith(github.ref, 'refs/heads/pull-request/')
40+
runs-on: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && 'linux-amd64-gpu-rtxpro6000-latest-1' || 'linux-amd64-gpu-rtxpro6000-latest-2' }}
41+
timeout-minutes: 15
42+
container:
43+
image: nvcr.io/nvidia/pytorch:26.01-py3
4944
env:
5045
GIT_DEPTH: 1000 # For correct version
5146
PIP_CONSTRAINT: "" # Disable pip constraint for upgrading packages
5247
HF_TOKEN: ${{ secrets.HF_TOKEN }}
53-
steps: &regression_steps
48+
steps:
5449
- uses: actions/checkout@v6
5550
- uses: nv-gha-runners/setup-proxy-cache@main
5651
- name: Setup environment variables
@@ -60,9 +55,7 @@ jobs:
6055
env:
6156
COVERAGE_PROCESS_START: ${{ github.workspace }}/pyproject.toml
6257
COVERAGE_FILE: ${{ github.workspace }}/.coverage
63-
run: |
64-
pip install nox
65-
nox -s ${{ matrix.example }}
58+
run: python -m pip install nox && nox -s regression
6659
- name: Upload regression coverage to Codecov
6760
uses: codecov/codecov-action@v5
6861
with:
@@ -71,21 +64,15 @@ jobs:
7164
flags: regression
7265
fail_ci_if_error: false # test may be skipped if relevant file changes are not detected
7366
verbose: true
74-
regression-tests-non-pr:
75-
if: ${{ !startsWith(github.ref, 'refs/heads/pull-request/') }}
76-
strategy: *regression_strategy
77-
runs-on: linux-amd64-gpu-rtxpro6000-latest-2
78-
timeout-minutes: ${{ matrix.timeout }}
79-
container: *regression_container
80-
steps: *regression_steps
67+
8168
regression-pr-required-check:
82-
# Run even if regression-tests-pr is skipped
69+
# Run even if regression-tests is skipped
8370
if: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && always() }}
84-
needs: [pr-gate, regression-tests-pr]
71+
needs: [pr-gate, regression-tests]
8572
runs-on: ubuntu-latest
8673
steps:
8774
- name: Required regression tests did not succeed
8875
if: |
8976
needs.pr-gate.result != 'success' ||
90-
(needs.pr-gate.outputs.any_changed == 'true' && needs.regression-tests-pr.result != 'success')
77+
(needs.pr-gate.outputs.any_changed == 'true' && needs.regression-tests.result != 'success')
9178
run: exit 1

0 commit comments

Comments
 (0)