Skip to content

Commit 7c3cdbb

Browse files
authored
[executorch][cuda] Unify model export and runtime CI jobs (pytorch#21955)
Run each CUDA model export and runtime test in the same reusable workflow job while preserving artifacts consumed by pybind coverage to reduce the extra environment installation time.
1 parent 0772148 commit 7c3cdbb

1 file changed

Lines changed: 13 additions & 157 deletions

File tree

‎.github/workflows/cuda.yml‎

Lines changed: 13 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ jobs:
248248
ctest --test-dir cmake-out -R test_cuda_allocator --output-on-failure -V
249249
ctest --test-dir cmake-out -R test_cuda_mutable_state --output-on-failure -V
250250
251-
export-model-cuda-artifact:
252-
name: export-model-cuda-artifact
251+
test-model-cuda-e2e:
252+
name: test-model-cuda-e2e-${{ matrix.model.name }}-${{ matrix.quant }}
253253
# Skip this job if the pull request is from a fork (HuggingFace secrets are not available).
254254
# Path-filtered on push: mirrors the workflow-level pull_request `paths:`
255255
# filter so push commits that don't touch CUDA-relevant paths skip
@@ -352,7 +352,7 @@ jobs:
352352
repo: "facebook"
353353
name: "dinov2-small-imagenet1k-1-layer"
354354
quant: "quantized-int4-weight-only"
355-
# Qwen3 int4-weight-only: no downstream job consumes this artifact
355+
# Keep the existing Qwen3 coverage to non-quantized and tile-packed.
356356
- model:
357357
repo: "Qwen"
358358
name: "Qwen3-0.6B"
@@ -377,7 +377,7 @@ jobs:
377377
name: "whisper-large-v3-turbo"
378378
quant: "non-quantized"
379379
with:
380-
timeout: 150
380+
timeout: 240
381381
secrets-env: EXECUTORCH_HF_TOKEN
382382
runner: ${{ (matrix.model.name == 'Qwen3.5-35B-A3B-HQQ-INT4' || matrix.model.name == 'gemma-4-31B-it-GGUF') && 'mt-l-x86iavx512-11-125-a100' || 'mt-l-x86aavx2-29-113-a10g' }}
383383
gpu-arch-type: cuda
@@ -419,153 +419,10 @@ jobs:
419419
echo "::endgroup::"
420420
fi
421421
422-
source .ci/scripts/export_model_artifact.sh cuda "${{ matrix.model.repo }}/${{ matrix.model.name }}" "${{ matrix.quant }}" "${RUNNER_ARTIFACT_DIR}"
423-
424-
test-model-cuda-e2e:
425-
name: test-model-cuda-e2e
426-
# Same path filter as export-model-cuda-artifact above. Also explicitly
427-
# gated on the export job succeeding — when needs: jobs are *skipped*
428-
# (e.g. fork PR), GitHub still evaluates this if:, so without the
429-
# explicit success-check this job would run and then fail trying
430-
# to download an artifact that was never produced.
431-
needs: [changed-files, export-model-cuda-artifact, run-decision]
432-
if: |
433-
needs.export-model-cuda-artifact.result == 'success' &&
434-
(
435-
contains(needs.changed-files.outputs.changed-files, 'backends/cuda') ||
436-
contains(needs.changed-files.outputs.changed-files, 'backends/aoti') ||
437-
contains(needs.changed-files.outputs.changed-files, '.github/workflows/cuda.yml') ||
438-
contains(needs.changed-files.outputs.changed-files, '.ci/scripts/test-cuda-build.sh') ||
439-
contains(needs.changed-files.outputs.changed-files, '.ci/scripts/export_model_artifact.sh') ||
440-
contains(needs.changed-files.outputs.changed-files, '.ci/scripts/test_model_e2e.sh') ||
441-
needs.run-decision.outputs.is-full-run == 'true'
442-
)
443-
uses: pytorch/test-infra/.github/workflows/linux_job_v3.yml@main
444-
permissions:
445-
id-token: write
446-
contents: read
447-
strategy:
448-
fail-fast: false
449-
matrix:
450-
model:
451-
- repo: "mistralai"
452-
name: "Voxtral-Mini-3B-2507"
453-
- repo: "mistralai"
454-
name: "Voxtral-Mini-4B-Realtime-2602"
455-
- repo: "nvidia"
456-
name: "diar_streaming_sortformer_4spk-v2"
457-
- repo: "openai"
458-
name: "whisper-small"
459-
- repo: "openai"
460-
name: "whisper-large-v3-turbo"
461-
- repo: "google"
462-
name: "gemma-3-4b-it"
463-
- repo: "nvidia"
464-
name: "parakeet-tdt"
465-
- repo: "facebook"
466-
name: "dinov2-small-imagenet1k-1-layer"
467-
- repo: "SocialLocalMobile"
468-
name: "Qwen3.5-35B-A3B-HQQ-INT4"
469-
- repo: "unsloth"
470-
name: "gemma-4-31B-it-GGUF"
471-
quant:
472-
- "non-quantized"
473-
- "quantized-int4-tile-packed"
474-
- "quantized-int4-weight-only"
475-
exclude:
476-
# TODO: enable int4-weight-only on gemma3.
477-
- model:
478-
repo: "google"
479-
name: "gemma-3-4b-it"
480-
quant: "quantized-int4-weight-only"
481-
# Qwen3.5 MoE uses a prequantized checkpoint, only tile-packed
482-
- model:
483-
repo: "SocialLocalMobile"
484-
name: "Qwen3.5-35B-A3B-HQQ-INT4"
485-
quant: "non-quantized"
486-
- model:
487-
repo: "SocialLocalMobile"
488-
name: "Qwen3.5-35B-A3B-HQQ-INT4"
489-
quant: "quantized-int4-weight-only"
490-
# Gemma 4 31B uses a prequantized checkpoint, only tile-packed
491-
- model:
492-
repo: "unsloth"
493-
name: "gemma-4-31B-it-GGUF"
494-
quant: "non-quantized"
495-
- model:
496-
repo: "unsloth"
497-
name: "gemma-4-31B-it-GGUF"
498-
quant: "quantized-int4-weight-only"
499-
# Voxtral Realtime only supports int4-tile-packed on CUDA
500-
- model:
501-
repo: "mistralai"
502-
name: "Voxtral-Mini-4B-Realtime-2602"
503-
quant: "non-quantized"
504-
- model:
505-
repo: "mistralai"
506-
name: "Voxtral-Mini-4B-Realtime-2602"
507-
quant: "quantized-int4-weight-only"
508-
# Sortformer currently supports only non-quantized export
509-
- model:
510-
repo: "nvidia"
511-
name: "diar_streaming_sortformer_4spk-v2"
512-
quant: "quantized-int4-tile-packed"
513-
- model:
514-
repo: "nvidia"
515-
name: "diar_streaming_sortformer_4spk-v2"
516-
quant: "quantized-int4-weight-only"
517-
# DINOv2 currently supports only non-quantized export
518-
- model:
519-
repo: "facebook"
520-
name: "dinov2-small-imagenet1k-1-layer"
521-
quant: "quantized-int4-tile-packed"
522-
- model:
523-
repo: "facebook"
524-
name: "dinov2-small-imagenet1k-1-layer"
525-
quant: "quantized-int4-weight-only"
526-
- model:
527-
repo: "nvidia"
528-
name: "parakeet-tdt"
529-
quant: "quantized-int4-weight-only"
530-
# Whisper: cover all quant types and both sizes with minimal combos
531-
# whisper-small: non-quantized only
532-
# whisper-large-v3-turbo: int4-tile-packed + int4-weight-only
533-
- model:
534-
repo: "openai"
535-
name: "whisper-small"
536-
quant: "quantized-int4-tile-packed"
537-
- model:
538-
repo: "openai"
539-
name: "whisper-small"
540-
quant: "quantized-int4-weight-only"
541-
- model:
542-
repo: "openai"
543-
name: "whisper-large-v3-turbo"
544-
quant: "non-quantized"
545-
with:
546-
timeout: 90
547-
runner: ${{ (matrix.model.name == 'Qwen3.5-35B-A3B-HQQ-INT4' || matrix.model.name == 'gemma-4-31B-it-GGUF') && 'mt-l-x86iavx512-11-125-a100' || 'mt-l-x86aavx2-29-113-a10g' }}
548-
gpu-arch-type: cuda
549-
gpu-arch-version: "13.0"
550-
use-custom-docker-registry: false
551-
submodules: recursive
552-
download-artifact: ${{ matrix.model.repo }}-${{ matrix.model.name }}-cuda-${{ matrix.quant }}
553-
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
554-
script: |
555-
# OSDC runners can't reach the public PyPI CDN that download.pytorch.org's
556-
# transitive deps resolve to. Pre-install torch's pure-python deps from the
557-
# in-cluster pypi-cache and drop the default cpu extra-index so the cuda
558-
# torch wheel is the only candidate.
559-
export PIP_EXTRA_INDEX_URL=
560-
# fsspec is pinned to satisfy datasets' fsspec[http]<=2025.3.0 so the later
561-
# examples install doesn't try to downgrade it from the public CDN.
562-
pip install filelock typing-extensions "setuptools<82" sympy networkx jinja2 "fsspec[http]<=2025.3.0" numpy pillow
563-
# OSDC mounts HF_HOME read-only at /mnt/hf_cache; redirect to a writable dir
564-
# (RUNNER_TEMP, or /tmp when RUNNER_TEMP isn't writable inside the container).
565-
export HF_HOME="${RUNNER_TEMP:-/tmp}/hf_cache"
566-
mkdir -p "${HF_HOME}" 2>/dev/null || export HF_HOME=/tmp/hf_cache
567-
mkdir -p "${HF_HOME}"
568-
source .ci/scripts/test_model_e2e.sh cuda "${{ matrix.model.repo }}/${{ matrix.model.name }}" "${{ matrix.quant }}" "${RUNNER_ARTIFACT_DIR}"
422+
RUN_EXPORT=1 source .ci/scripts/test_model_e2e.sh cuda \
423+
"${{ matrix.model.repo }}/${{ matrix.model.name }}" \
424+
"${{ matrix.quant }}" \
425+
"${RUNNER_ARTIFACT_DIR}"
569426
570427
test-muse-glimmer-cuda-e2e:
571428
name: test-muse-glimmer-cuda-e2e-${{ matrix.variant }}-${{ matrix.mode }}
@@ -639,13 +496,12 @@ jobs:
639496
640497
test-cuda-pybind:
641498
name: test-cuda-pybind
642-
# This job downloads models exported by export-model-cuda-artifact and runs them using pybind.
643-
# Same gating as test-model-cuda-e2e — explicit success-check on the
644-
# export job so a skipped export (fork PR, non-sampled push, no path
645-
# match) auto-skips this job too.
646-
needs: [changed-files, export-model-cuda-artifact, run-decision]
499+
# This job downloads models exported by test-model-cuda-e2e and runs them using pybind.
500+
# Explicitly check the producer job so a skipped run (fork PR,
501+
# non-sampled push, or no path match) auto-skips this job too.
502+
needs: [changed-files, test-model-cuda-e2e, run-decision]
647503
if: |
648-
needs.export-model-cuda-artifact.result == 'success' &&
504+
needs.test-model-cuda-e2e.result == 'success' &&
649505
(
650506
contains(needs.changed-files.outputs.changed-files, 'backends/cuda') ||
651507
contains(needs.changed-files.outputs.changed-files, 'backends/aoti') ||

0 commit comments

Comments
 (0)