Add flashinfer rmsnorm + quant fusion support SM90, SM100, SM120 - #32994
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
2259dc5 to
2694840
Compare
b1c70aa to
700395c
Compare
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
/rerun-failed-ci |
1 similar comment
|
/rerun-failed-ci |
|
/rerun-failed-ci |
1 similar comment
|
/rerun-failed-ci |
|
/rerun-stage base-b-test-1-gpu-small |
|
Stage granularity is too coarse — a stage usually doesn't map to one feature, so rerunning a stage re-pays the cost of unrelated tests. If you don't know which exact test files to rerun, you shouldn't be using Use one of these instead:
AMD CI: stage-level dispatch is still available via Actions UI → PR Test (AMD) / PR Test ROCm 7.2 (AMD) → Run workflow → pick a stage from the dropdown. |
|
#33441, hopefully this helps with dependency failures |
Signed-off-by: Devashish Lal <devcode@fb.com>
Signed-off-by: Devashish Lal <devcode@fb.com>
…-project#32994) Signed-off-by: Devashish Lal <devcode@fb.com> Co-authored-by: Devashish Lal <devcode@fb.com> Co-authored-by: Xiaoyu Zhang <1182563586@qq.com>
…M120- sgl-project#32994 (sgl-project#33471) Signed-off-by: Devashish Lal <devcode@fb.com> Co-authored-by: Devashish Lal <devcode@fb.com> Co-authored-by: Xiaoyu Zhang <1182563586@qq.com>
…-project#32994) Signed-off-by: Devashish Lal <devcode@fb.com> Co-authored-by: Devashish Lal <devcode@fb.com> Co-authored-by: Xiaoyu Zhang <1182563586@qq.com>
…M120- sgl-project#32994 (sgl-project#33471) Signed-off-by: Devashish Lal <devcode@fb.com> Co-authored-by: Devashish Lal <devcode@fb.com> Co-authored-by: Xiaoyu Zhang <1182563586@qq.com>
…-project#32994) Signed-off-by: Devashish Lal <devcode@fb.com> Co-authored-by: Devashish Lal <devcode@fb.com> Co-authored-by: Xiaoyu Zhang <1182563586@qq.com>
…M120- sgl-project#32994 (sgl-project#33471) Signed-off-by: Devashish Lal <devcode@fb.com> Co-authored-by: Devashish Lal <devcode@fb.com> Co-authored-by: Xiaoyu Zhang <1182563586@qq.com>
…-project#32994) Signed-off-by: Devashish Lal <devcode@fb.com> Co-authored-by: Devashish Lal <devcode@fb.com> Co-authored-by: Xiaoyu Zhang <1182563586@qq.com>
…M120- sgl-project#32994 (sgl-project#33471) Signed-off-by: Devashish Lal <devcode@fb.com> Co-authored-by: Devashish Lal <devcode@fb.com> Co-authored-by: Xiaoyu Zhang <1182563586@qq.com>
Motivation
I had been working on the torch compile fusion approach for this for a while and am not sure what's gonna happen with it but the kernel gains are significant and can easily be done directly, this builds upon the norm quant kernels added to flashinfer which are faster than the kernels I tried writing for jit kernels (cuz they use clusters)
H100 Gains are in the range of 1.5%~2.5%
B200 Gains are in the range of 4%~5%
references
To be merged in two parts due to AOT kernel changes
B200 Gains
Modifications
Fuse RMSNorm with downstream static per-tensor FP8 activation quantization using FlashInfer's
rmsnorm_quantandfused_add_rmsnorm_quantkernels. The norm can emit an already-quantized FP8 activation, allowing the following FP8 linear layer to skip its activation quantization.On SM90, channelwise CUTLASS FP8 GEMMs now consume the scalar activation scale directly instead of expanding it per token, eliminating the extra copy that reduced the fusion benefit.
Changes
(fp8, scale, original_dtype)inputs.--enable-flashinfer-rmsnorm-fp8-quant, disabled by default.In future PR's I hope to expand model support for this fusion
Accuracy Tests
GSM8k H100
RedHatAI/Meta-Llama-3.1-8B-FP8
RedHatAI/Llama-2-7b-chat-hf-FP8
RedHatAI/Qwen2-7B-Instruct-FP8
Speed Tests and Profiling
Kernel Benchmark H100
Kernel Benchmark B200
Bench one batch H100
RedHatAI/Meta-Llama-3.1-8B-FP8
RedHatAI/Llama-2-7b-chat-hf-FP8
RedHatAI/Qwen2-7B-Instruct-FP8
Bench One Batch B200
RedHatAI/Meta-Llama-3.1-8B-FP8
RedHatAI/Llama-2-7b-chat-hf-FP8
RedHatAI/Qwen2-7B-Instruct-FP8
Online benchmark sweep H100
RedHatAI/Meta-Llama-3.1-8B-FP8
Online Benchmark Sweep B200
RedHatAI/Meta-Llama-3.1-8B-FP8
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ⏳ Run #30863863022
Latest PR Test (Extra): ⏳ Run #30863862825