Repository navigation
cuda: launch Qwen's FP8 RoPE plain under PDL, so fp8 KV tokens match PDL off (#5308) - #5353
Merged
Merged
Conversation
ashhart
force-pushed
the
lead/qwen-fp8-rope-pdl
branch
from
November 27, 2026 11:14
4d80bb0 to
0bae6dd
Compare
FP8 RoPE has no dependency wait, so a dependent launch can read Kn before the preceding K-head norm finishes. Keep only that launch stream-ordered; all proven-safe PDL launches stay unchanged. Add a recording host regression and a GB10 int8-prompt/FP8-KV byte-parity stress contract.
ashhart
force-pushed
the
lead/qwen-fp8-rope-pdl
branch
from
November 27, 2026 13:01
0bae6dd to
331db47
Compare
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.
Fixes #5308. Since v1.3.5,
TF_QWEN_PDLis on by default on sm_12x. With--kv-cache fp8(and the reporter's--prompt-precision int8), greedy replies changed and drafted no longer equalled plain;TF_QWEN_PDL=0was exact.Cause: the FP8 RoPE kernel (
rope8) was launched as a programmatic dependent launch, but its body has no dependency-wait prologue. It could start while the preceding norm was still writing the K rows it reads, so the FP8 K-cache bytes depended on timing. The fix launchesrope8plain; every other launch, and the whole default bf16 path, is unchanged.Evidence on one GB10 (sm_121), Qwen3.8-27B MLX 4-bit, the reporter's exact recipe (
--context 32768 --parallel 1 --prompt-cache-gib 0), four greedy requests per arm, done shas:eb415dcbaf6e ffd8ce19a679 f28349df6aca 2c73c3410e76(plain),... 14c292d669bb a372f7da4806 b9f60e4f767b(drafted)eb415dcbaf6e 32770168799b 4b07984a0d32 e54a38dcef83eb415dcbaf6e 32770168799b 4b07984a0d32 e54a38dcef83, plain and draftedThe PDL-off shas match the reporter's RTX 5090 results exactly.
contract_qwen_pdl.zigadds a launch-table regression that fails on main (the FP8 RoPE launch carried the dependent attribute) and an int8-to-FP8 PDL on/off output-bytes contract for the device.