Skip to content

[Deps] Upgrade CUDA PyTorch stack to 2.13 - #28836

Merged
Fridge003 merged 221 commits into
mainfrom
mmangkad/torch-2.12
Aug 6, 2026
Merged

Fridge003 merged 221 commits into
mainfrom
mmangkad/torch-2.12

Conversation

@mmangkad

@mmangkad mmangkad commented Jun 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

torch: 2.11.0 → 2.13.0
torchvision: 0.26.0 → 0.28.0
triton: 3.6.0 → 3.7.1
torchaudio: stays at 2.11.0
triton_kernels: 3.6.0 → 3.7.1
torchcodec: 0.11.1 → 0.15.0

Test Plan

CI


CI States

Latest PR Test (Base): ✅ Run #31093990866
Latest PR Test (Extra): ✅ Run #31102164675

mmangkad added 30 commits May 17, 2026 17:47
The mergehead sparse attention wrapper allocates column_index with torch.empty, and the CUDA kernel only writes entries that are covered by column_count. Entries past column_count are padding with undefined contents, not part of the kernel result contract.

The previous test compared the entire column_index tensor, including uninitialized padding slots with hard-coded stale allocator values. That happened to pass under older torch/CUDA allocation behavior, but torch 2.12 can expose different contents in those unused slots.

Assert column_count explicitly and compare only the valid column_index prefix for each row instead, which matches how callers are expected to consume the output.
The previous follow-up corrected the assertion to compare only valid column_index prefixes, but the expected Python lists had one extra nesting level. That made each row compare against a nested row list instead of the expected list of column indices.

Use the same batch/head/row structure as the assertion loop so the test validates the intended column_count-bounded prefixes.
Torch 2.12 brings NCCL 2.29, whose default allows NVLS and activates it on compatible Hopper-or-newer NVSwitch systems. In diffusion CI, NCCL process-group initialization can fail while binding NVLS multicast memory when Fabric Manager or NVSwitch state is not ready.

Set NCCL_NVLS_ENABLE=0 during diffusion launch setup when the variable is unset, matching the conservative default used by the main SGLang runtime while keeping this as a temporary CI workaround.

Reference CI failure: https://github.com/sgl-project/sglang/actions/runs/26239210518/job/77224480316?pr=25984
Torch 2.12 added aten::rms_norm to the CUDA autocast fp32 policy in aten/src/ATen/autocast_mode.h. That means q/k tensors entering torch.nn.RMSNorm as bf16/fp16 now come back as fp32 under autocast; Torch 2.11 left the RMSNorm result in the original input dtype.

LTX2 attention forwards the normalized q/k tensors into the selected attention backend. The FlashAttention path rejects fp32 inputs with "FlashAttention only supports fp16, bf16, and fp8_e4m3 data type", which caused the LTX2 diffusion CI failures after the Torch 2.12 upgrade.

Store the projection output dtype before qk norm and cast the normalized q/k tensors back to that original attention dtype. This preserves the existing attention dtype contract without forcing a specific precision for non-FA paths.
Torch 2.12 upgrades the CUDA wheel from NCCL 2.28.9 to NCCL 2.29.7. In NCCL 2.28, the default NVLS path could fail multicast memory binding and continue by disabling NVLS. In NCCL 2.29, the same cuMulticastBindMem failure now returns ncclUnhandledCudaError and aborts process group initialization.

The RL memory-release test calls torch.distributed.init_process_group directly with a CUDA device_id before the SGLang engine environment defaults are applied, so it can hit this NCCL 2.29 NVLS hard failure during eager NCCL connection. Set NCCL_NVLS_ENABLE=0 before that direct init path, matching the existing SGLang default behavior for stable CI.

Also update the diffusion launcher FIXME to document the verified NCCL behavior change instead of describing this as only a diffusion-specific workaround.
The SM120-only GPT-OSS 20B test runs on the 1-gpu-small runner and was inheriting the shared GPT-OSS 20B CUDA graph capture limit of 600. With the current Torch/Triton stack, startup can OOM during MXFP4 MoE graph capture before the GPQA eval begins.

Call the raw GPT-OSS eval helper for this test so only the SM120 lane uses a smaller CUDA graph max batch size. Cap max running requests to the GPQA per-eval thread count as well, keeping the server-side request pressure aligned with the test workload.
The sgl-router workflow can run before experimental/sgl-router has landed, for example when the workflow file itself is touched. In that state the lint job fails immediately because experimental/sgl-router/Cargo.toml does not exist.

Detect whether the router Cargo.toml is present after checkout. When it is absent, make the lint job emit a notice and skip router-specific steps, and gate downstream build/e2e jobs on the detected source being present.
A job cannot become skipped after it starts, so the previous guard made tier-1 lint succeed after detecting that experimental/sgl-router was absent.

Split the source detection into a small prerequisite job and gate the real tier-1 lint job on router_present. When the router source has not landed yet, lint and downstream router jobs are now skipped in the GitHub UI.
SMG GPU e2e installs SGLang from the local checkout, which imports sglang-kernel during CI prevalidation. On this Torch upgrade branch the published sglang-kernel wheel can be ABI-incompatible with the installed torch, producing undefined symbols from common_ops.

Build the sgl-kernel CUDA wheel with the existing reusable workflow and download it into sgl-kernel/dist before installing SGLang dependencies. This follows the same CUSTOM_BUILD_SGL_KERNEL path used by the main CUDA stage workflows while keeping the existing smg-wheel build separate.
SMG e2e needs a branch-compatible sglang-kernel wheel on Torch upgrade branches, but building another copy inside the SMG workflow duplicates PR Test Base work and queues another x64-kernel-build-node job.

Replace the SMG-owned sgl-kernel build with a lightweight lookup of the matching PR Test Base run for the same PR head SHA. If Base produced wheel-python3.10-cuda13.0, SMG downloads that artifact and installs dependencies with CUSTOM_BUILD_SGL_KERNEL=true. If Base skipped the kernel build, SMG falls back to the normal published wheel path.
The 1-gpu-small SM120 CI runner still OOMs during CUDA graph capture after capping GPT-OSS 20B graph capture at bs=198. The server auto-computes mem_fraction_static=0.864 for that configuration, which leaves only about 4GB free before graph capture while the MXFP4 MoE Triton path needs more headroom.\n\nSet --mem-fraction-static=0.75 for this SM120-specific test to reduce the KV/static pool and leave enough memory for graph capture.
Replace the SMG cross-workflow Base artifact lookup with the same local wheel-build pattern used by the CUDA PR workflows.\n\nSMG now detects sgl-kernel-affecting changes with the same path filter used by Base and Extra, builds an x64 sgl-kernel wheel only when that filter is true, and otherwise lets gateway e2e install the normal published kernel package. This avoids the undefined-symbol failure for kernel-changing PRs without always spending time on a custom kernel build.
Keep the SM120 non-persistent StridedLayout MXFP4 path from selecting the one-warp Triton kernel that regressed decode throughput, but do not force every shape to num_warps=4.

triton_kernels 3.7 exposes num_warps only as an exact constraint, so use a narrow wrapper around compute_num_warps to apply a minimum of 4 only for the SM120 StridedLayout MXFP4 path. This preserves larger dynamic selections for prefill/concurrency-heavy shapes.
Torch 2.12 bundles NCCL 2.29, which hard-fails NVLS multicast bind errors that NCCL 2.28 used to handle by disabling NVLS and continuing. The JIT multigpu unit tests launch torchrun directly through the shared multiprocess_test helper, before the normal SGLang runtime defaults apply, so pass NCCL_NVLS_ENABLE=0 into those worker processes.
Comment thread .github/workflows/pr-test.yml Resolved
Comment thread .github/workflows/rerun-test.yml Resolved
@b8zhong

b8zhong commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

/rerun-test python/sglang/multimodal_gen/test/unit/test_glm_image_ar.py

@github-actions

github-actions Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test python/sglang/multimodal_gen/test/unit/test_glm_image_ar.py:

🚀 1-gpu-h100 (1 test): ❌ View workflow run

python3 -m pytest python/sglang/multimodal_gen/test/unit/test_glm_image_ar.py -x

@mmangkad

mmangkad commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Latest CI run with 1 failure already resolved on main and 1 unrelated failure


CI States

Latest PR Test (Base): ❌ Run #31059661914
Latest PR Test (Extra): ✅ Run #31059661679

@mmangkad

mmangkad commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

I realized we should keep forcing deepep rebuilds briefly after merging so every runner replaces its stale torch 2.11 build, then remove it once the fleet has cycled

@mmangkad

mmangkad commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor Author

/rerun-test test/registered/attention/unittests/gdn/test_gdn_replayssm_spec_fold.py test/registered/models_e2e/test_kimi_k3_b300.py

@github-actions

github-actions Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test test/registered/attention/unittests/gdn/test_gdn_replayssm_spec_fold.py test/registered/models_e2e/test_kimi_k3_b300.py:

🚀 1-gpu-h100 (1 test): ✅ View workflow run

cd test/ && python3 registered/attention/unittests/gdn/test_gdn_replayssm_spec_fold.py

🚀 8-gpu-b300 (1 test): ✅ View workflow run

cd test/ && python3 registered/models_e2e/test_kimi_k3_b300.py

@mmangkad

mmangkad commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

CI States

Latest PR Test (Base): ✅ Run #31093990866
Latest PR Test (Extra): ✅ Run #31102164675

@b8zhong b8zhong left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally

@Fridge003 Fridge003 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally

This branch was successfully deployed

1 active deployment
staging - docs — ca4ec692 Deployed Aug 6, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blackwell SM100/SM120 bypass-fastfail deepseek dependencies Pull requests that update a dependency file diffusion SGLang Diffusion documentation Improvements or additions to documentation high priority jit-kernel Multi-modal multi-modal language model quant LLM Quantization ready-to-merge The PR is ready to merge after the CI is green. release-highlight Candidate PR for release note highlight run-ci CI: run the baseline test suite on this PR run-ci-extra CI: also run the extra suite (requires run-ci) sgl-kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants