Skip to content

[qwen4-main-squashed] Cherry-pick #36811: avoid zero-bias allocation in fused softmax routing (fixes GB10 NEXTN collapse) - #38308

Merged
Jiminator merged 1 commit into
qwen4-main-squashedfrom
qwen4-main-squashed-cherry-pick-36811
Sep 7, 2026
Merged

Jiminator merged 1 commit into
qwen4-main-squashedfrom
qwen4-main-squashed-cherry-pick-36811

Conversation

@Jiminator

@Jiminator Jiminator commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Cherry-pick of #36811 (main commit 221a627) onto qwen4-main-squashed. One trivial conflict resolved: this branch still had the assert bias.dtype == torch.float32 line that #36811 deletes.

Why

On DGX Spark (GB10) every NEXTN cell of Qwen3.8-Flash-Next-NVFP4 built from this branch sporadically collapses to repeated ! (NaN logits, #37111). Root cause: fused_topk passes a fresh torch.zeros bias to the Triton router kernel, which loads it before its PDL wait, so under programmatic dependent launch it can read the buffer's previous bytes; on GB10 the MTP draft leaves NaN there. An instrumented run captured the kernel consuming NaN bias before the wait, zeros after it, with correct logits. #36811 removes the zero-bias allocation for softmax routing, so there is no buffer left to read early.

Validation (1x DGX Spark, RadixArk/Qwen3.8-Flash-Next-NVFP4, NEXTN 3/1/4, radix cache off, 8 running requests, GSM8K 1319 + churn client, the shape that collapsed within 2 to 25 min in most runs on this branch tip)

With only this cherry-pick applied: 0.971 accuracy, 0 invalid, 1319/1319 stopped normally, 0 NaN events, 0 routing mismatches against a settled reference recomputed after the kernel. The unpatched branch collapsed twice in the same hours on the same shape.

The kernel-side hardening (wait before the bias load, Triton + radix) is proposed separately against main in #38290 and is not required for this branch's cells.


CI States

Latest PR Test (Base): ❌ Run #34104919156
Latest PR Test (Extra): ❌ Run #34104918908
Latest PR Test (AMD ROCm 7.2): ❌ Run #34104919185

@Jiminator
Jiminator merged commit c8457de into qwen4-main-squashed Sep 7, 2026
80 of 90 checks passed
@Jiminator
Jiminator deleted the qwen4-main-squashed-cherry-pick-36811 branch September 7, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants