Skip to content

Skip autodiff finalization passes for modules with no autodiff IR #25479

Skip autodiff finalization passes for modules with no autodiff IR

Skip autodiff finalization passes for modules with no autodiff IR #25479

Workflow file for this run

name: CI
on:
workflow_dispatch:
merge_group:
types: [checks_requested]
pull_request:
branches: [master]
types: [opened, synchronize, reopened, ready_for_review]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name != 'push' }}
jobs:
filter:
if: github.event_name != 'pull_request' || github.event.pull_request.draft != true
runs-on: ubuntu-latest
outputs:
should-run: ${{ steps.filter.outputs.should-run }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "2"
- id: filter
run: |
# This step prevents subsequent steps from running if only documentation was changed
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
git fetch origin ${{ github.base_ref }}
BASE=origin/${{ github.base_ref }}
else
BASE=HEAD^1
fi
shouldRun=true
if files="$(git diff --name-only $BASE...HEAD)"; then
# Git diff succeeded, check if non-documentation files were changed
if echo "$files" | grep -qvE '^(docs/|LICENSES/|LICENSE$|CONTRIBUTING\.md$|README\.md$)'; then
shouldRun=true
else
echo "Only documentation files changed, skipping remaining steps"
shouldRun=false
fi
else
echo "Git diff failed, conservatively running tests"
shouldRun=true
fi
echo "should-run=$shouldRun" >> $GITHUB_OUTPUT
# Linux builds (containerized builds on GitHub-hosted runners)
build-linux-debug-gcc-x86_64:
needs: [filter]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-build-container.yml
with:
config: debug
runs-on: '["ubuntu-22.04"]'
build-linux-release-gcc-x86_64:
needs: [filter]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-build-container.yml
with:
config: release
runs-on: '["ubuntu-22.04"]'
build-linux-release-gcc-wasm:
needs: [filter]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-build.yml
with:
os: linux
compiler: gcc
platform: wasm
config: release
runs-on: '["ubuntu-22.04"]'
# Sanitizer build+test (blocking via check-ci, runs on every PR)
sanitizer-linux-clang-x86_64:
needs: [filter]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-sanitizer.yml
with:
runs-on: '["ubuntu-22.04"]'
# macOS builds
build-macos-debug-clang-aarch64:
needs: [filter]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-build.yml
with:
os: macos
compiler: clang
platform: aarch64
config: debug
runs-on: '["macos-latest"]'
build-macos-release-clang-aarch64:
needs: [filter]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-build.yml
with:
os: macos
compiler: clang
platform: aarch64
config: release
runs-on: '["macos-latest"]'
# Linux ARM64 builds (GitHub-hosted)
build-linux-debug-gcc-aarch64:
needs: [filter]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-build.yml
with:
os: linux
compiler: gcc
platform: aarch64
config: debug
runs-on: '["ubuntu-24.04-arm"]'
warnings-as-errors: false
build-linux-release-gcc-aarch64:
needs: [filter]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-build.yml
with:
os: linux
compiler: gcc
platform: aarch64
config: release
runs-on: '["ubuntu-24.04-arm"]'
warnings-as-errors: false
# Windows builds (self-hosted)
build-windows-debug-cl-x86_64-gpu:
needs: [filter]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-build.yml
with:
os: windows
compiler: cl
platform: x86_64
config: debug
runs-on: '["Windows", "self-hosted", "build"]'
build-windows-release-cl-x86_64-gpu:
needs: [filter]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-build.yml
with:
os: windows
compiler: cl
platform: x86_64
config: release
runs-on: '["Windows", "self-hosted", "build"]'
# Linux tests (self-hosted GPU runner, containerized)
test-linux-debug-gcc-x86_64:
needs: [filter, build-linux-debug-gcc-x86_64]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-test-container.yml
with:
config: debug
server-count: 4
test-linux-release-gcc-x86_64:
needs: [filter, build-linux-release-gcc-x86_64]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-test-container.yml
with:
config: release
server-count: 4
# Linux x86_64 SM80+ capability tests (self-hosted L4/Blackwell runner).
# Runs only cooperative-matrix / neural coverage that T4 cannot safely
# execute after CUDA coopmat moves to Ampere-only mma.sync PTX.
test-linux-release-gcc-x86_64-sm80:
needs: [filter, build-linux-release-gcc-x86_64]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-test-container.yml
with:
config: release
runs-on: '["Linux", "self-hosted", "SM80Plus"]'
gpu-tier: sm80plus
run-rhi-tests: false
server-count: 4
# Linux x86_64 CPU-only tests (GitHub-hosted; no GPU).
# Runs the -category full suite filtered to CPU and LLVM backends via
# -api cpu+llvm, so GPU-targeted test variants are ignored rather than run.
# Catches frontend / IR / diagnostic regressions on cheap hardware and
# complements the GPU-runner jobs.
test-linux-release-gcc-x86_64-cpu:
needs: [filter, build-linux-release-gcc-x86_64]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-test.yml
with:
os: linux
compiler: gcc
platform: x86_64
config: release
runs-on: '["ubuntu-24.04"]'
test-category: full
full-gpu-tests: false
cpu-only: true
# Keep the CPU-only tier off the persistent test-server while we
# investigate intermittent JSON RPC failures on GitHub-hosted runners.
server-count: 1
# macOS tests
test-macos-debug-clang-aarch64:
needs: [filter, build-macos-debug-clang-aarch64]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-test.yml
with:
os: macos
compiler: clang
platform: aarch64
config: debug
runs-on: '["macos-latest"]'
test-category: smoke
full-gpu-tests: true
server-count: 3
test-macos-release-clang-aarch64:
needs: [filter, build-macos-release-clang-aarch64]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-test.yml
with:
os: macos
compiler: clang
platform: aarch64
config: release
runs-on: '["macos-latest"]'
test-category: full
full-gpu-tests: true
server-count: 3
# Linux ARM64 tests (GitHub-hosted, CPU only)
test-linux-debug-gcc-aarch64:
needs: [filter, build-linux-debug-gcc-aarch64]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-test.yml
with:
os: linux
compiler: gcc
platform: aarch64
config: debug
runs-on: '["ubuntu-24.04-arm"]'
test-category: smoke
full-gpu-tests: false
test-linux-release-gcc-aarch64:
needs: [filter, build-linux-release-gcc-aarch64]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-test.yml
with:
os: linux
compiler: gcc
platform: aarch64
config: release
runs-on: '["ubuntu-24.04-arm"]'
test-category: smoke
full-gpu-tests: false
# Windows GPU tests (self-hosted)
test-windows-debug-cl-x86_64-gpu:
needs: [filter, build-windows-debug-cl-x86_64-gpu]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-test.yml
with:
os: windows
compiler: cl
platform: x86_64
config: debug
runs-on: '["Windows", "self-hosted", "GCP-T4"]'
test-category: full
full-gpu-tests: true
gpu-tier: t4
test-windows-release-cl-x86_64-gpu:
needs: [filter, build-windows-release-cl-x86_64-gpu]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-test.yml
with:
os: windows
compiler: cl
platform: x86_64
config: release
runs-on: '["Windows", "self-hosted", "GCP-T4"]'
test-category: full
full-gpu-tests: true
gpu-tier: t4
# MaterialX Integration Tests (Windows only for initial validation)
test-materialx-windows-release:
needs: [filter, build-windows-release-cl-x86_64-gpu]
if: needs.filter.outputs.should-run == 'true' && github.event_name == 'pull_request'
uses: ./.github/workflows/materialx-test.yml
with:
os: windows
compiler: cl
platform: x86_64
config: release
runs-on: '["windows-latest"]'
check-ci:
needs:
[
test-windows-release-cl-x86_64-gpu,
test-windows-debug-cl-x86_64-gpu,
test-macos-release-clang-aarch64,
test-macos-debug-clang-aarch64,
test-linux-release-gcc-x86_64,
test-linux-release-gcc-x86_64-sm80,
test-linux-release-gcc-x86_64-cpu,
test-linux-debug-gcc-x86_64,
test-linux-release-gcc-aarch64,
test-linux-debug-gcc-aarch64,
test-materialx-windows-release,
sanitizer-linux-clang-x86_64,
]
runs-on: ubuntu-latest
if: always() && (github.event_name != 'pull_request' || github.event.pull_request.draft != true)
steps:
- name: Check CI Results
run: |
echo "=== CI Results Summary ==="
echo "Windows Release GPU: ${{ needs.test-windows-release-cl-x86_64-gpu.result }}"
echo "Windows Debug GPU: ${{ needs.test-windows-debug-cl-x86_64-gpu.result }}"
echo "macOS Release ARM64: ${{ needs.test-macos-release-clang-aarch64.result }}"
echo "macOS Debug ARM64: ${{ needs.test-macos-debug-clang-aarch64.result }}"
echo "Linux Release x64: ${{ needs.test-linux-release-gcc-x86_64.result }}"
echo "Linux Release x64 SM80Plus: ${{ needs.test-linux-release-gcc-x86_64-sm80.result }}"
echo "Linux Release x64 CPU: ${{ needs.test-linux-release-gcc-x86_64-cpu.result }}"
echo "Linux Debug x64: ${{ needs.test-linux-debug-gcc-x86_64.result }}"
echo "Linux Release ARM64: ${{ needs.test-linux-release-gcc-aarch64.result }}"
echo "Linux Debug ARM64: ${{ needs.test-linux-debug-gcc-aarch64.result }}"
echo "MaterialX Windows: ${{ needs.test-materialx-windows-release.result }}"
echo "Sanitizer Linux: ${{ needs.sanitizer-linux-clang-x86_64.result }}"
# Check if any required jobs failed (allow success or skipped)
if [[ "${{ needs.test-windows-release-cl-x86_64-gpu.result }}" == "failure" ]] || \
[[ "${{ needs.test-windows-debug-cl-x86_64-gpu.result }}" == "failure" ]] || \
[[ "${{ needs.test-macos-release-clang-aarch64.result }}" == "failure" ]] || \
[[ "${{ needs.test-macos-debug-clang-aarch64.result }}" == "failure" ]] || \
[[ "${{ needs.test-linux-release-gcc-x86_64.result }}" == "failure" ]] || \
[[ "${{ needs.test-linux-release-gcc-x86_64-sm80.result }}" == "failure" ]] || \
[[ "${{ needs.test-linux-release-gcc-x86_64-cpu.result }}" == "failure" ]] || \
[[ "${{ needs.test-linux-debug-gcc-x86_64.result }}" == "failure" ]] || \
[[ "${{ needs.test-linux-release-gcc-aarch64.result }}" == "failure" ]] || \
[[ "${{ needs.test-linux-debug-gcc-aarch64.result }}" == "failure" ]] || \
[[ "${{ needs.test-materialx-windows-release.result }}" == "failure" ]] || \
[[ "${{ needs.sanitizer-linux-clang-x86_64.result }}" == "failure" ]] || \
[[ "${{ needs.test-windows-release-cl-x86_64-gpu.result }}" == "cancelled" ]] || \
[[ "${{ needs.test-windows-debug-cl-x86_64-gpu.result }}" == "cancelled" ]] || \
[[ "${{ needs.test-macos-release-clang-aarch64.result }}" == "cancelled" ]] || \
[[ "${{ needs.test-macos-debug-clang-aarch64.result }}" == "cancelled" ]] || \
[[ "${{ needs.test-linux-release-gcc-x86_64.result }}" == "cancelled" ]] || \
[[ "${{ needs.test-linux-release-gcc-x86_64-sm80.result }}" == "cancelled" ]] || \
[[ "${{ needs.test-linux-release-gcc-x86_64-cpu.result }}" == "cancelled" ]] || \
[[ "${{ needs.test-linux-debug-gcc-x86_64.result }}" == "cancelled" ]] || \
[[ "${{ needs.test-linux-release-gcc-aarch64.result }}" == "cancelled" ]] || \
[[ "${{ needs.test-linux-debug-gcc-aarch64.result }}" == "cancelled" ]] || \
[[ "${{ needs.sanitizer-linux-clang-x86_64.result }}" == "cancelled" ]] || \
[[ "${{ needs.test-materialx-windows-release.result }}" == "cancelled" ]]; then
echo "One or more CI jobs failed or were cancelled"
exit 1
fi
echo "All CI jobs completed successfully (passed or skipped)!"
# Automatically retry GPU health check failures by dispatching ci-retry.yml,
# which watches this run until it completes, then reruns only failed jobs.
# Capped at 2 automatic retries via run_attempt check.
retry-on-gpu-failure:
needs: [check-ci]
if: failure() && github.event_name == 'merge_group' && fromJSON(github.run_attempt) < 3
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Check for GPU health check failures and dispatch retry
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
run: |
gpu_failures=$(gh api "repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs?per_page=100" \
--jq '[.jobs[]
| select(.conclusion == "failure")
| select(any(.steps[]?;
(.name == "GPU health check" and .conclusion == "failure") or
(.name == "GPU post-test diagnostics" and .conclusion == "failure")
))
] | length' \
|| echo "0")
gpu_failures=${gpu_failures:-0}
if ! [[ "$gpu_failures" =~ ^[0-9]+$ ]]; then
gpu_failures=0
fi
if [ "$gpu_failures" -gt 0 ]; then
echo "Found $gpu_failures GPU failure(s) — dispatching retry workflow..."
gh workflow run ci-retry.yml -F run_id=${{ github.run_id }}
else
echo "No GPU failures — not retrying."
fi