Skip to content

Fuse gated rmsnorm + group_quant for qwen3next and qwen3.5 - #2499

Merged
ganyi1996ppo merged 12 commits into
mainfrom
ganyi/gated_rmsnorm_quant
Apr 9, 2026
Merged

ganyi1996ppo merged 12 commits into
mainfrom
ganyi/gated_rmsnorm_quant

Conversation

@ganyi1996ppo

Copy link
Copy Markdown
Contributor

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

@ganyi1996ppo
ganyi1996ppo requested review from a team and Copilot March 27, 2026 03:30
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:triton-355 Run Triton tests on MI355 in addition to MI325
ci:sglang SGLang integration tests
ci:atom ATOM benchmark (DeepSeek-R1 + GPT-OSS)
ci:vllm vLLM benchmark
ci:all All of the above

Add labels via the sidebar or gh pr edit 2499 --add-label <label>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new fused HIP kernel and JIT binding for “gated RMSNorm + FP8 (per-128) group quantization” intended for Qwen-family model shapes (head_dim=128, group_size=128), along with a new operator test and JIT compile configuration.

Changes:

  • Add fused HIP kernel implementation for gated RMSNorm + FP8 group quantization with optional transposed scale storage.
  • Add Python JIT stub/binding and corresponding JIT compile module configuration.
  • Add a new op test script comparing the fused kernel vs existing per-group quantization.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
op_tests/test_gated_rmsnorm_fp8_group_quant.py New validation/perf test comparing fused kernel vs reference quant path.
csrc/pybind/gated_rmsnorm_quant_pybind.cu New pybind module entrypoint for the JIT extension.
csrc/kernels/gated_rmsnorm_quant_kernels.cu New fused HIP kernel + C++ launcher + Python-exposed entrypoint.
aiter/ops/gated_rmsnorm_fp8_group_quant.py New compile_ops Python stub for calling the JIT-compiled kernel.
aiter/jit/optCompilerConfig.json Registers the new JIT module sources/includes/flags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wuhuikx
wuhuikx requested review from XiaobingSuper and xytpai March 27, 2026 09:28
@wuhuikx

wuhuikx commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

wuhuikx
wuhuikx previously approved these changes Apr 3, 2026
ganyi1996ppo and others added 12 commits April 9, 2026 11:18
Signed-off-by: ganyi <[email protected]>
Signed-off-by: ganyi <[email protected]>
remove large case

Co-authored-by: Copilot <[email protected]>
Signed-off-by: ganyi <[email protected]>
Signed-off-by: ganyi <[email protected]>
Signed-off-by: ganyi <[email protected]>
Signed-off-by: ganyi <[email protected]>
Signed-off-by: ganyi <[email protected]>
@ganyi1996ppo
ganyi1996ppo force-pushed the ganyi/gated_rmsnorm_quant branch from f3388ff to 50e5faa Compare April 9, 2026 03:18
@ganyi1996ppo
ganyi1996ppo merged commit 875f6b7 into main Apr 9, 2026
23 of 24 checks passed
@ganyi1996ppo
ganyi1996ppo deleted the ganyi/gated_rmsnorm_quant branch April 9, 2026 14:50
sunway513 pushed a commit that referenced this pull request Apr 21, 2026
* fuse gated_rmsnorm_quant

Signed-off-by: ganyi <[email protected]>

* format

Signed-off-by: ganyi <[email protected]>

* add header file

Signed-off-by: ganyi <[email protected]>

* transpose scale as template param

Signed-off-by: ganyi <[email protected]>

* use opus for dtype max

Signed-off-by: ganyi <[email protected]>

* Apply suggestion from @Copilot

remove large case

Co-authored-by: Copilot <[email protected]>

* fix test

Signed-off-by: ganyi <[email protected]>

* add md summary

Signed-off-by: ganyi <[email protected]>

* fix ruff

Signed-off-by: ganyi <[email protected]>

* fix ut

Signed-off-by: ganyi <[email protected]>

* replace ck to opus

Signed-off-by: ganyi <[email protected]>

* remove all ck related code

Signed-off-by: ganyi <[email protected]>

---------

Signed-off-by: ganyi <[email protected]>
Co-authored-by: Copilot <[email protected]>
Liang-jianhao97 pushed a commit that referenced this pull request Apr 30, 2026
* fuse gated_rmsnorm_quant

Signed-off-by: ganyi <[email protected]>

* format

Signed-off-by: ganyi <[email protected]>

* add header file

Signed-off-by: ganyi <[email protected]>

* transpose scale as template param

Signed-off-by: ganyi <[email protected]>

* use opus for dtype max

Signed-off-by: ganyi <[email protected]>

* Apply suggestion from @Copilot

remove large case

Co-authored-by: Copilot <[email protected]>

* fix test

Signed-off-by: ganyi <[email protected]>

* add md summary

Signed-off-by: ganyi <[email protected]>

* fix ruff

Signed-off-by: ganyi <[email protected]>

* fix ut

Signed-off-by: ganyi <[email protected]>

* replace ck to opus

Signed-off-by: ganyi <[email protected]>

* remove all ck related code

Signed-off-by: ganyi <[email protected]>

---------

Signed-off-by: ganyi <[email protected]>
Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants