Repository navigation
[HIP] Optional sigmoid on gated_rmsnorm_fp8_per_token_quant - #5392
Merged
junhaha666 merged 4 commits intoOct 9, 2026
Merged
junhaha666 merged 4 commits into
junhaha666 merged 4 commits into
Conversation
Default stays SiLU (norm(x) * silu(z)). use_sigmoid=True uses sigmoid(z) instead, compiled via a USE_SIGMOID kernel template. Group-quant is unchanged.
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags & labels: |
Contributor
Author
|
@junhaha666 could you please help review? Thanks! |
junhaha666
approved these changes
Oct 9, 2026
This was referenced Oct 13, 2026
yuychang
added a commit
to yuychang/sglang
that referenced
this pull request
Oct 16, 2026
…rm FP8 fusion - Pass use_sigmoid=True to gated_rmsnorm_fp8_per_token_quant, matching ROCm/aiter#5392. - Update the comment: the kernel no longer rounds the gated value through bf16 before quantizing.
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.
Summary
gated_rmsnorm_fp8_per_token_quantis SiLU-only today (norm(x) * silu(z)), from #3844. Qwen GDN / SGLang #28655 need that default. Kimi-K3o_normisFusedRMSNormGated(activation="sigmoid"):norm(x) * sigmoid(z).This PR adds
use_sigmoid=Falseon the existing API (last arg, default false). HostifinstantiatesUSE_SIGMOIDon the kernel, same pattern asTRANSPOSE_SCALEon the group kernel in this file. RMSNorm, token-wide amax, FP8 store, and the0x80flush are unchanged.gated_rmsnorm_fp8_group_quantis not touched.Testing
op_tests/test_gated_rmsnorm_fp8_quant.pychecks the HIP kernel against a PyTorch reference (dequantized values + per-token scales) for both gates:use_sigmoid=False) vs a SiLU refuse_sigmoid=Truevs a sigmoid ref--dtype bf16/--dtype fp16)gfx950 MI355X, image
rocm/pytorch:rocm7.2.4_ubuntu24.04_py3.12_pytorch_release_2.10.0.Dequant
checkAllclose atol=rtol=0.01(fail if mismatch fraction> 5%); scalesatol=rtol=0.001.This run: 112/112
Test PASSED, 0failed!. 65 dequantwarning!(34 bf16, 31 fp16) are FP8 tails at0.0%mismatch; they also show up on the unchanged group kernel.Latency
Same launch and shapes. Sigmoid is the same kernel minus the extra
zmultiply. HIP times stay in the same band across gates and across bf16/fp16.HIP times (us):