Skip to content

[AMD] Fix the QuickReduce bf16 cast failing to build for CDNA - #37132

Merged
alexnails merged 2 commits into
mainfrom
amd_fix_install_dependency_0830
Aug 31, 2026
Merged

alexnails merged 2 commits into
mainfrom
amd_fix_install_dependency_0830

Conversation

@yctseng0211

@yctseng0211 yctseng0211 commented Aug 30, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

#34484 blocked the (bf16_as_f32 * scale) -> fp16 reassociation by naming v_cvt_pk_f16_f32 in 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_f32 ahead of v_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

  1. Ping Merge Oncalls to start the process. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • Common commands include /tag-and-rerun-ci, /tag-run-ci-label, /rerun-failed-ci
  4. After green CI and required approvals, ask Merge Oncalls or people with Write permission to merge the PR.

CI States

Latest PR Test (Base): 🚫 Run #33351561701
Latest PR Test (Extra): ❌ Run #33351561593
Latest PR Test (AMD ROCm 7.2): 🚫 Run #33351561744

@yctseng0211

Copy link
Copy Markdown
Collaborator Author

unblocked amd install dependency :
image

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>
@alexnails
alexnails merged commit 5972211 into main Aug 31, 2026
125 of 164 checks passed
@alexnails
alexnails deleted the amd_fix_install_dependency_0830 branch August 31, 2026 03:57
StevenChenSE pushed a commit to StevenChenSE/sglang that referenced this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bypass-fastfail high priority run-ci CI: run the baseline test suite on this PR sgl-kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants