Repository navigation
[AMD] Fix the QuickReduce bf16 cast failing to build for CDNA - #37132
Merged
Merged
Conversation
yctseng0211
requested review from
FlamingoPg,
merrymercy and
yizhang2077
as code owners
August 30, 2026 12:49
5 tasks done
Collaborator
Author
Encode MODE.FP16_OVFL as a one-bit field so the write does not target adjacent bit 24. Co-authored-by: Cursor <cursoragent@cursor.com>
5 tasks
StevenChenSE
pushed a commit
to StevenChenSE/sglang
that referenced
this pull request
Sep 6, 2026
…oject#37132) Co-authored-by: Alex Nails <alex.nails@radixark.ai>
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.

Motivation
#34484 blocked the
(bf16_as_f32 * scale) -> fp16reassociation by namingv_cvt_pk_f16_f32in inline asm, but that instruction is not part of the CDNA ISA, so every gfx942 build now fails to assemble (error: instruction not supported on this GPU) and takes the AMD CI down with it.What stopped the reassociation was making the scaled values opaque to the optimizer rather than the choice of instruction, so this swaps the named instruction for an empty asm barrier and leaves the narrowing to
__float22half2_rn— portable to every target, and the same round-to-nearest conversion the quantized path in this file already uses.Verified on gfx942, gfx950 and gfx90a: the generated gfx942 asm keeps
v_mul_f32ahead ofv_cvt_f16_f32, and removing the barrier makes the multiply vanish entirely, which is exactly the reassociation #34484 set out to prevent.Modifications
Accuracy Tests
Speed Tests and Profiling
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): 🚫 Run #33351561701
Latest PR Test (Extra): ❌ Run #33351561593
Latest PR Test (AMD ROCm 7.2): 🚫 Run #33351561744