Example tests #4240
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Example tests | |
| on: | |
| push: | |
| branches: ["pull-request/[0-9]+"] | |
| # NOTE: paths cannot be used since push happens to copied PR and only latest commit to PR is used | |
| schedule: | |
| - cron: "0 0 * * *" # Nightly | |
| workflow_dispatch: | |
| # On-demand | |
| concurrency: | |
| # Cancel previous runs if new commit is pushed to the same PR | |
| group: ${{ github.workflow }}-${{ startsWith(github.ref, 'refs/heads/pull-request/') && github.ref || github.sha }} | |
| cancel-in-progress: true | |
| jobs: | |
| pr-gate: | |
| uses: ./.github/workflows/_pr_gate.yml | |
| permissions: | |
| checks: read | |
| secrets: inherit | |
| with: | |
| files: | | |
| .github/workflows/example_tests.yml | |
| examples/** | |
| modelopt/** | |
| pyproject.toml | |
| tests/examples/** | |
| ##### PyTorch Example Tests (speculative_decoding requires 26.01 image) ##### | |
| torch: | |
| needs: [pr-gate] | |
| if: needs.pr-gate.outputs.any_changed == 'true' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| example: [llm_distill, llm_qat, llm_sparsity, diffusers_sparsity] | |
| include: | |
| - example: speculative_decoding | |
| docker_image: "26.01" | |
| uses: ./.github/workflows/_example_tests_runner.yml | |
| secrets: inherit | |
| with: | |
| docker_image: "nvcr.io/nvidia/pytorch:${{ matrix.docker_image || '26.03' }}-py3" | |
| example: ${{ matrix.example }} | |
| timeout_minutes: 30 | |
| pip_install_extras: "[hf,dev-test]" | |
| runner: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && 'linux-amd64-gpu-rtxpro6000-latest-1' || 'linux-amd64-gpu-rtxpro6000-latest-2' }} | |
| ##### TensorRT-LLM Example Tests (pr/non-pr split: non-pr runs extra autodeploy+eval examples) ##### | |
| trtllm-pr: | |
| needs: [pr-gate] | |
| if: startsWith(github.ref, 'refs/heads/pull-request/') && needs.pr-gate.outputs.any_changed == 'true' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| example: [llm_ptq, vlm_ptq] | |
| uses: ./.github/workflows/_example_tests_runner.yml | |
| secrets: inherit | |
| with: | |
| docker_image: "nvcr.io/nvidia/tensorrt-llm/release:1.3.0rc12" | |
| example: ${{ matrix.example }} | |
| pip_install_extras: "[hf,dev-test]" | |
| runner: linux-amd64-gpu-rtxpro6000-latest-1 | |
| trtllm-non-pr: | |
| if: ${{ !startsWith(github.ref, 'refs/heads/pull-request/') }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| example: [llm_autodeploy, llm_eval, llm_ptq, vlm_ptq] | |
| uses: ./.github/workflows/_example_tests_runner.yml | |
| secrets: inherit | |
| with: | |
| docker_image: "nvcr.io/nvidia/tensorrt-llm/release:1.3.0rc12" | |
| example: ${{ matrix.example }} | |
| pip_install_extras: "[hf,dev-test]" | |
| runner: linux-amd64-gpu-rtxpro6000-latest-2 | |
| ##### Megatron Example Tests ##### | |
| megatron: | |
| needs: [pr-gate] | |
| if: needs.pr-gate.outputs.any_changed == 'true' | |
| uses: ./.github/workflows/_example_tests_runner.yml | |
| secrets: inherit | |
| with: | |
| docker_image: "nvcr.io/nvidia/nemo:26.02" | |
| example: megatron_bridge | |
| timeout_minutes: 30 | |
| pip_install_extras: "[hf,puzzletron,dev-test]" | |
| runner: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && 'linux-amd64-gpu-rtxpro6000-latest-1' || 'linux-amd64-gpu-rtxpro6000-latest-2' }} | |
| ##### ONNX/TensorRT Example Tests ##### | |
| onnx: | |
| needs: [pr-gate] | |
| if: needs.pr-gate.outputs.any_changed == 'true' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| example: [diffusers, torch_onnx] | |
| uses: ./.github/workflows/_example_tests_runner.yml | |
| secrets: inherit | |
| with: | |
| docker_image: "nvcr.io/nvidia/tensorrt:26.02-py3" | |
| example: ${{ matrix.example }} | |
| pip_install_extras: "[onnx,hf,dev-test]" | |
| runner: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && 'linux-amd64-gpu-rtxpro6000-latest-1' || 'linux-amd64-gpu-rtxpro6000-latest-2' }} | |
| ##### Required Check for PR ##### | |
| example-pr-required-check: | |
| # Run even if example tests are skipped | |
| if: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && always() }} | |
| needs: [pr-gate, torch, trtllm-pr, megatron, onnx] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Required example tests did not succeed | |
| if: | | |
| needs.pr-gate.result != 'success' || | |
| (needs.pr-gate.outputs.any_changed == 'true' && ( | |
| needs.torch.result != 'success' || | |
| needs.trtllm-pr.result != 'success' || | |
| needs.megatron.result != 'success' || | |
| needs.onnx.result != 'success' | |
| )) | |
| run: exit 1 |