Repository navigation
Run GPU CI only for PRs targeting main - #2870
Merged
Merged
Conversation
Contributor
A PR whose base is another PR's branch (a stacked slice) now skips them, and its required checks fail with a message saying the tests are deferred until it targets main. Stacked branches were ~69% of GPU CI hours on Oct 13-16 because every restack re-ran full CI on every slice. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Keval Morabia <[email protected]>
They are the same base branches the unit tests run for. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Keval Morabia <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Keval Morabia <[email protected]>
kevalmorabia97
force-pushed
the
kmorabia/ci-gpu-stacked-gate
branch
from
October 19, 2026 19:02
16bb328 to
e087204
Compare
kevalmorabia97
requested review from
h-guo18 and
sugunav14
and removed request for
a team
October 19, 2026 19:02
kevalmorabia97
requested review from
kaix-nv and
kinjalpatel27
and removed request for
a team
October 19, 2026 19:02
kevalmorabia97
removed request for
a team,
h-guo18,
kaix-nv,
kinjalpatel27,
sugunav14 and
vishalpandya1990
October 19, 2026 19:03
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2870 +/- ##
==========================================
+ Coverage 76.99% 78.92% +1.93%
==========================================
Files 658 658
Lines 73986 73986
==========================================
+ Hits 56965 58397 +1432
+ Misses 17021 15589 -1432
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
kevalmorabia97
enabled auto-merge (squash)
October 19, 2026 19:42
Contributor
|
kevalmorabia97
added a commit
that referenced
this pull request
Oct 20, 2026
…iners, trim slow GPU tests (#2836) ### What does this PR do? Type of change: CI / tests (follow-up to #2832) Related: #2870 (independent, targets `main`) runs GPU CI only for PRs targeting `main`. - **gpu_megatron timeouts, root cause:** Megatron's `destroy_model_parallel()` only drops its references to the NCCL groups, so each test's communicators stayed alive in the persistent workers: about 20 groups and 0.4 GiB of device memory per test (1221 groups and 24 GiB after 61 tests of `test_megatron.py`). Later tests got slower until they hit the 120 s timeout (the nightly cancellations), and smaller GPUs hit NCCL CUDA errors. `megatron_worker_teardown` now destroys every non-default group; `test_megatron.py` stays at 1 group and ~1-3 GiB and passes 131/131 in 4:54 on 2 GPUs (was 3 failures and slower). - **Worker pool:** a failing rank is now reported before its teardown runs. In `gpu_megatron`, teardown starts with `dist.barrier()`, which blocked against a still-running peer, so the parent never heard of the failure and the 30 s grace period could not start (it waited for the pytest timeout). New test fails without the fix. Also the remaining #2832 review nits (fixture-scope note, comments) and the sub-millisecond `get_live_pool` test moved to `tests/unit`. - **Wheel cache for the `gpu` job:** `mamba_ssm`, `causal-conv1d` and `fast-hadamard-transform` were compiled from sdist on every run (~10 min of the job, e.g. 4 + 6 min on 10-16). They are now pinned in `noxfile.py` and built into a wheelhouse that `actions/cache` keeps per container image (key includes the `noxfile.py` hash); a wheel is only built when the wheelhouse lacks it. A plain wheelhouse rather than pip's or uv's cache: pip does not cache wheels it builds from a local source tree (the C++20-patched sdist) or reliably from a git URL, its cache lives under `HOME` (`/github/home` in container jobs), and the GPU sessions use the container's own pip (`venv_backend="none"`), not uv. A directory of wheels keyed on the image and `noxfile.py` is explicit and is saved only once complete. - **CUDA-extension cache never worked for the nightly:** across 25 nightlies the `gpu` job never found its `torch_extensions` cache (205-350 s of extension compile each night; `gpu_megatron` hit about half the nights). `actions/cache` saves only when the job succeeds, and the nightly was failing or timing out every night, so main's cache scope was never populated (PR runs save into their own `pull-request/N` scope, which the nightly cannot read). The extension cache and the wheelhouse are now restored with `actions/cache/restore` and saved with `actions/cache/save` under `always()` (new `.github/actions/save-extensions`). - **Container bumps:** pytorch 26.05/26.07 -> 26.09. **TensorRT-LLM stays at rc20**: no later release runs the multimodal quickstart that `test_qwen_vl` uses (rc21-rc23 import `MultimodalConfig`, which `tensorrt_llm.llmapi` does not export yet; rc24+ import `fla`, which the image lacks). NeMo 26.08 is already the newest public image. **vLLM stays at v0.30.0**: v0.31.0 breaks the vLLM plugin (`test_kimi_gemm_rs_ar_bypasses_enabled_fake_quantizers`: `gemm_rs_ar` has no `.apply`; `test_flashinfer_metadata_builder_patch_stashes_common_metadata`: `FlashInferMetadataBuilder.cache_config`; `test_tiny_llama_quantize` times out) and needs plugin changes by its owners. The `gpu_vllm` job on `v0.20.0` (legacy FusedMoE registration, vLLM < 0.24) is dropped; v0.30.0 is the only vLLM job, and its timeout goes from 15 to 30 min: on PRs (1 GPU) its tests take ~10 min plus ~5 min to pull the image, so it timed out twice with all tests passing; the 2-GPU nightly also runs the TP2 tests and needs ~22 min. - **Extension cache key:** keyed only on the C++/CUDA sources and their build scripts, so editing a Triton kernel no longer forces a rebuild (that rebuild pushed `gpu_vllm` past its 15 min limit). The key now also includes the job name: example and GPU jobs on the same image shared one key, and an example job that builds no extensions finished first and saved an empty cache. `gpu` and `gpu_megatron` then restored it as an exact hit, recompiled on every run (`test_cuda_ext` took 35-46 s in every `gpu` run of this PR), and could never save their own (`Unable to reserve cache ... another job may be creating this cache`). This also affects `main`. The save step now skips when no `.so` was built, so a run cancelled before building anything cannot claim the key with an empty cache. The `tensorrt:26.05` images used by the ONNX/diffusers examples stay: `torch-tensorrt` (<2.13) needs `libnvinfer.so.10`, which newer images drop. - **mamba_ssm / causal-conv1d on pytorch:26.09:** their `setup.py` hardcodes `-std=c++17` but the 26.09 torch headers need C++20 (`ATen requires C++20`), so the wheels are built with the standard patched to C++20 (checked to compile and import against torch 2.13 headers). - **NVFP4 scale conversion without TensorRT-LLM's `auto_deploy`** (removed in rc29, so the next bump would otherwise break): ModelOpt's NVFP4 dequantize/export paths (and `gpu_trtllm` collection) failed with `ModuleNotFoundError`. The cutlass-swizzled block-scale conversion is a tensor permutation, now implemented in ModelOpt as the inverse of `swizzle_nvfp4_scales` (same math as TensorRT-LLM's helper; bit-identical to rc20's on 6 shapes) with a CPU round-trip test. - **conv3d implicit-GEMM JIT build:** `implicit_gemm_cuda.py` passed `-std=c++17`, which fails against the 26.09 torch headers (165 GPU test failures); torch's `load()` now picks the standard. - **FSDP2 + layerwise calibration bug:** `persistent_materialization` patched `FSDPParamGroup.unshard/reshard` on the class, so while one layer was materialized *every* FSDP module skipped unshard; a full forward then ran on sharded DTensor params (`test_layerwise_calibrate_fsdp2` failed on torch 2.14 with `'FSDPParam' object has no attribute '_unsharded_param'`). Now patched only on the param groups inside the layer, and only when the layer itself is FSDP-wrapped (otherwise nothing was gathered for its FSDP submodules, so they must still unshard). CPU/gloo regression test fails without the fix; a second test covers a shared `fully_shard([a, b])` group, nested contexts, a pre-existing instance override and a non-FSDP layer (fails without the group dedup or the FSDP-wrapped check). - **EAGLE training crash (found by the new container):** `hf_eagle.py` compiled `_eagle_forward` with `mode="max-autotune"`, which enables inductor CUDA graphs; recording them intermittently fails (`cudaStreamCaptureStatusInvalidated` / "graph recording observed an input tensor deallocate"). It failed `test_llama_eagle3` on 5 of the last 10 nightlies and on the `pytorch:26.09` dispatch run. Now `max-autotune-no-cudagraphs` (same autotuning, no graphs). Training-speed impact not measured. - **NVFP4 FP8-sweep kernel compile time:** the kernel was autotuned over three tile configs, so first use compiled all three (~70 s per dtype on the `pytorch:26.09` runner), pushing the MSE-sweep export and calibration tests past the 120 s timeout. It now uses the config that was fastest on B300 (BLOCKS_PER_PROGRAM=64, 8 warps; on Ada all three were within ~8% from 256² to 16384x8192). Cold first call drops from 13.6 s to 5.4 s locally, which also helps users' first MSE calibration in each process. - **Stale xfails:** removed the five `xfail(raises=RuntimeError)` markers in `test_megatron_preprocess_data.py`; they xpassed in all 151 PR runs and every nightly that reached them over the last week (one of them never touches HF). - **Dedupe:** removed `tests/gpu_megatron/_extensions/test_torch_extensions.py`, an exact copy of `tests/gpu/_extensions/` (the megatron conftest already prebuilds the extensions). - **Puzzletron e2e trimmed:** Puzzletron is not actively maintained, so CI runs only Nemotron-3-Nano (hybrid MoE), gpt-oss and Qwen3-VL; the other six models are `manual` (~40 s each, ~4 min of the `gpu` job). Run them with `--run-manual`. - **New 2-GPU nightly failures (from tests merged Oct 19):** `gpu_vllm`'s new TP2 tests (#2842) failed because vLLM needs 160 MiB of `/dev/shm` and the container had Docker's default 64 MiB; the GPU test container now gets `--shm-size=2gb`, like the example jobs. `test_distill_llm_sft_hf_chat[True]` (#2873, packed SFT on a tiny MoE at TP2) failed on the sm_120 runner with "No dot product attention backend is available": the tiny model's head_dim of 2 leaves only TE's unfused attention, which the 2-GPU sm_120 runner rejects for packed input (it passes on Ada); the packed case now uses head_dim 8 so the flash and cuDNN backends also qualify. Both only run on the 2-GPU nightly, not in single-GPU PR CI. - **`gpu_megatron` timeout 60 -> 75 min:** PR runs (1 GPU) take ~42 min, but the nightly runs every test on 2 GPUs: 46.5 min on Oct 19, then cancelled at 60 min with 99% done on Oct 20, and at 89% in this branch's dispatch run. - **Unit CI timeout on `main` (Oct 20):** `test_hf_dflash2.py::test_overfits_a_single_batch` took 51-61 s on most unit runners (2-7 s on others) and hit its 60 s timeout, also in main's nightly; both accuracies pass 0.9 by step ~21, so it now runs 30 steps instead of 60 (8 s on one CPU thread, was 16 s). - **Blackwell illegal-memory-access flake:** `test_fp8_real_quantize` (both 2-GPU dispatch runs) and `test_layerwise_calibrate_vlm_text_forward_loop[True]` (PR CI) hit the intermittent CUDA illegal memory access that `skip_flaky_on_blackwell` already skips for ~50 tests in `test_megatron.py`; they get the same marker. Not caused by this PR: `test_megatron.py` alone passed on the same 2-GPU runners in all 4 variants (this branch, and with main's conftest and/or worker pool), and the whole file passes on 2x Ada. - **`test_mamba_search_space` timeout 120 -> 150 s:** across ~135 PR `gpu_megatron` jobs on Oct 16-17 it usually took 64-76 s, ~15% took 85-103 s on slow runners, and it reached 112, 119 and 123 s (twice; one timed out here). Nightlies were ~72 s. ### Testing - Pool: the new test (rank 0 fails, rank 1 hangs, teardown barrier) fails without the fix (`queue.Empty` after the 30 s job timeout) and passes with it; CPU unit tests that use the shared pool pass. - Cache helper: stub-session check, cold cache runs `pip wheel` per missing package, warm cache runs none and installs the cached wheels. - Dispatched on this branch: Regression tests on `pytorch:26.09` passed; Unit tests passed. PR CI on 9d9ab38: everything green except `gpu` (2 FP8-sweep timeouts, fixed above); `gpu_megatron` passed in 32.5 min (60 min limit); the torch-extension cache was restored. - FP8 sweep: `tests/gpu/torch/quantization/test_nvfp4_fp8_sweep_kernel.py` and the accelerate MSE tests pass locally (Ada, torch 2.14); the `hf_ptq.py` export case was not run locally. - PR CI on f222d46: all checks green except `gpu_vllm` (all 190 tests passed, then hit the old 15 min limit) and `gpu_megatron` (`test_mamba_search_space` at 123 s, timeout raised above). The `gpu` job restored the wheelhouse and installed all three wheels without compiling. - FSDP: `tests/unit/torch/quantization/test_utils.py` passes on CPU; GPU FSDP2/layerwise/export tests pass in `nemo:26.08` (56 passed, 1 skipped). - Puzzletron/mamba: in `nemo:26.08` the six puzzletron models skip as manual and `test_mamba_search_space` passes with the new marker. - PR CI on f1311ea (per-job cache keys): all checks green. Each GPU job started cold on its new key and saved a populated extension cache (`gpu` 7 MB, `gpu_megatron` 5 MB, `gpu_trtllm` 5 MB, `gpu_vllm` 2 MB; before, `gpu` and `gpu_megatron` only ever had a 0 MB one). Re-running `gpu_trtllm` restored its cache: `test_cuda_ext` 33.2 s -> 3.1 s and the pytest step 202 s -> 79 s. - Eagle mode: `torch._inductor.list_mode_options` confirms `max-autotune` sets `triton.cudagraphs` and the new mode does not; `tests/unit/torch/speculative` (339) and `tests/gpu/torch/speculative` (14) pass. - 2-GPU nightly fixes (8f58d40): not reproduced locally (the packed test passes on Ada). Dispatched on this branch (2-GPU runners): [Example tests](https://github.com/NVIDIA/Model-Optimizer/actions/runs/39373464121) all 13 lanes passed, including `test_distill_llm_sft_hf_chat[True]`; in [GPU tests](https://github.com/NVIDIA/Model-Optimizer/actions/runs/39373461370) `gpu` and `gpu_trtllm` passed and both `gpu_vllm` TP2 tests passed, but `gpu_vllm` hit its 20 min limit at 51% of tests (raised to 30 min below) and `gpu_megatron` hit its 60 min limit at 89% (raised to 75 min below). [Re-dispatched GPU tests](https://github.com/NVIDIA/Model-Optimizer/actions/runs/39388346112) on f25ff98: `gpu`, `gpu_trtllm` and `gpu_vllm` passed (`gpu_vllm` 211 passed in 15 min); `gpu_megatron` 402 passed and failed only `test_fp8_real_quantize` (the Blackwell flake above). Looked at but left alone: the 11 unified-export cases (each hits a different fuse-flag branch). Shared worker pools across megatron modules and a preloaded forkserver (importing modelopt initializes CUDA) did not work out. - Is this change backward compatible?: ✅ - If you copied code from any other sources or added a new PIP dependency, did you follow guidance in `CONTRIBUTING.md`: N/A - Did you write any new necessary tests?: ✅ - Did you update Changelog?: N/A - Did you get Claude approval on this PR?: ❌ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Keval Morabia <[email protected]> Co-authored-by: Claude Sonnet 5.5 <[email protected]>
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 26, 2026
Ported from NVIDIA/Model-Optimizer#2870 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 26, 2026
Ported from NVIDIA/Model-Optimizer#2870 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 26, 2026
Ported from NVIDIA/Model-Optimizer#2870 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 26, 2026
Ported from NVIDIA/Model-Optimizer#2870 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 26, 2026
Ported from NVIDIA/Model-Optimizer#2870 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 26, 2026
Ported from NVIDIA/Model-Optimizer#2870 Generated by autojump (AI); review before merging.
6 tasks done
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Nov 2, 2026
docs: document GPU CI gating for main-targeted PRs (from NVIDIA/Model-Optimizer#2870)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Type of change: CI
Independent of #2836; can merge in either order.
GPU, example and regression tests now run only for PRs that target
main,release/*orfeature/*, the same base branches the unit tests and code-quality checks already run for (unit_tests.yml,code_quality.yml). A PR whose base is another PR's branch, i.e. an upper slice of a stack, skips all GPU jobs; only the bottom slice runs them. Such PRs already got no unit tests or code-quality checks, so until they targetmainthey get only DCO and the deferred messages.pr-merge-base(already called by both PR gates) reads the PR's base branch from the PR info it fetches and outputsstacked._pr_gate.yml(gpu, regression) and the examplepr-gatethen select no lanes, so the GPU jobs and the unit-test wait are skipped.mainwithout a new push (e.g. after the PR below it merges) could merge without ever running GPU tests. After retargeting, push or use Re-run all jobs (which re-reads the base); Re-run failed jobs reuses the old gate output.CONTRIBUTING.mddocuments this under "Submitting your code".Testing
actionlintpasses on the four workflows; the base-branch test (main/release/0.48.0/feature/foo-> not stacked, other branches -> stacked) and the example lane condition (stacked / not stacked / non-PR) checked in bash.*-pr-required-checks failed with "This PR targets another PR's branch, so GPU/example/regression tests are deferred until it targets main. After retargeting, push or use 'Re-run all jobs'."main(rebased off CI follow-up: cache source-built wheels and extensions, bump CI containers, trim slow GPU tests #2836, independent of it), so its own CI exercises the normal path.Before your PR is "Ready for review"
CONTRIBUTING.md: N/A🤖 Generated with Claude Code
Summary by CodeRabbit
main,release/*, orfeature/*.