Repository navigation
feat(rdna2): default the MoE quantized GEMM epilogue to fp32 - #153
Closed
BlivionIaG wants to merge 1 commit into
Closed
BlivionIaG wants to merge 1 commit into
BlivionIaG wants to merge 1 commit into
Conversation
VLLM_RDNA2_MOE_FP32_ACCUM now defaults on. =0 still selects the packed-fp16 CAS-64 path. Comments state that gfx1030 lowers the fp32 atomic to a CAS loop and that gfx1100 may use v_global_atomic_add_f32. Co-authored-by: BlivionIaG <BlivionIaG@users.noreply.github.com>
6 tasks done
Author
|
Closing: same change as #152 (default the MoE epilogue to fp32), rejected by the CAS default decision of 2026-10-01 ( |
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.
Overview
VLLM_RDNA2_MOE_FP32_ACCUMnow defaults on, so the RDNA2 W4A16/W4A8 MoE epilogue accumulates in an fp32 scratch and casts to fp16 once.VLLM_RDNA2_MOE_FP32_ACCUM=0still selects the packed-fp16 CAS-64 path. Comments that called the fp32 atomic a nativev_global_atomic_add_f32now match the ISA.Not a duplicate. Open PR #93 is the opt-in W8A8 sdot4 kernels, and #87 deletes old campaign drivers. No open issue tracks this default.
Claims
VLLM_RDNA2_MOE_FP32_ACCUMselects the fp32 scratch epilogue formoe_gptq_gemm_rdna2andmoe_w4a8_gemm_rdna2.=0(andfalse) still selects packed-fp16 CAS-64. Per-callfp32_accum=True/Falsestill overrides the snapshot.Validation
CPU only. This environment has no GPU, so the gfx1030 kernel tests were not run.
On the previous getter the new test failed at the unset case (
assert False is True). On this branch it passed (1 passed).ruff checkandruff format --checkpassed onvllm/envs.py,vllm/_custom_ops.py,tests/test_envs.py, andtests/kernels/quantization/test_rdna2_moe_w4a16.py.tests/kernels/quantization/test_rdna2_moe_w4a16.pystill monkeypatches_RDNA2_MOE_FP32_ACCUMfor both epilogues.test_fp32_accum_flag_off_byte_identical_to_casis the old "default off" case, renamed so it no longer describes the unset default. It was not executed here.No model eval. The default changes MoE outputs at the last fp16 ULPs.
Details
The shipping default is the env getter, snapshotted once at import by
vllm/_custom_ops.py(_RDNA2_MOE_FP32_ACCUM). Both the runtime lambda and theTYPE_CHECKINGannotation now default to true (os.getenv(..., "True")).Already consistent, left alone:
csrc/rocm/torch_bindings.cppalready defaultsfp32_accum=Trueon both ops. The schema was not edited, so the dual-archgfx1030;gfx1100_rocm_Csymbol list stays as fix(rocm): unbreak the gfx11 and host builds — four drifted stubs/guards at b740289353 #150 left it.tools/rdna/serve_rdna.shandtools/rdna/recipes/*.envdo not set the variable, so a recipe launch follows the code default.atomicAdd(float*)is not an explicitv_global_atomic_add_f32. gfx1030 has no global f32 atomic add, so that call compiles to a compare-and-swap loop. The instruction exists on gfx11; a gfx1100 compile of the helper may emit it. These kernels' device bodies stay gfx1030-only. The gfx1100 image is still the empty stub.Expected cost. On gfx1030 the fp32 path is a CAS-loop atomic into a scratch plus a cast, and it can be slower than packed-fp16 CAS-64, in exchange for one rounding at the end instead of an order-dependent fp16 atomic. The 2026-09-30 V620 Flash-Next matrix (
bench_results/2026-09-30_fp32-accum-matrix/SUMMARY.md, 4× V620, TP=4, FULL_AND_PIECEWISE) measured CAS faster by about +2.5% decode tok/s at MTP=0 c=1 and +12–13% at MTP=2 c=1, with c=8 near parity. That is not a measurement of this tree.Please measure decode tok/s and worst-case ITL on V620 before and after, on the recipe you serve (16k/1k and 1k/512, c=1 and c=8). Revert with:
The variable is a torch.compile factor, so the first serve after the flip recompiles graphs.
AI assistance was used (Cursor Agent). A human should review every line and run the gfx1030 MoE tests plus the V620 A/B above before relying on the new default.
Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.