perf: add native split gated RMSNorm for Qwen3.5 and Qwen3.6 on NPU#1936
Open
wanghuanjun2113 wants to merge 1 commit into
Open
perf: add native split gated RMSNorm for Qwen3.5 and Qwen3.6 on NPU#1936wanghuanjun2113 wants to merge 1 commit into
wanghuanjun2113 wants to merge 1 commit into
Conversation
wanghuanjun2113
requested review from
Clement-Wang26,
DongheJin,
DragonFive,
JimHsiung,
Kang-Meng,
RobbieLeung,
XuZhang99,
liujinguang0125,
liutongxuan,
walsonyang,
xiao-yu-chen,
yingxudeng,
yq33victor and
zhang-minchao
as code owners
July 13, 2026 10:49
- add an opt-in NPU path using native RMSNorm, SiLU, and in-place multiplication - preserve the fused implementation as the default and fallback path - limit the optimization to large two-dimensional inputs with matching norm dimensions
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.
中文说明
为什么修改
Qwen3.5/Qwen3.6 Gated DeltaNet 的大 token prefill 场景当前使用融合 Gated RMSNorm 算子。将该路径拆分为 Ascend 原生 RmsNorm、SiLU 和逐元素乘后,端到端测试中 6 个场景的 TTFT 和 E2E 均有改善,其中 35B TP=2/TP=4 的 E2E 分别提升 7.35%/5.49%。
怎么修改
XLLM_NATIVE_SPLIT_GATED_RMS_NORM=1显式启用,默认仍走原融合实现。rms_norm;gated_layer_norm路径。USE_NPU条件编译保护内,不影响其他后端。性能测试配置
95a3e499674900f6d08cce881d14e31479f14ca1负数表示优化版延迟降低。
验证
clang-format 20.1.6:通过。git diff --check:通过。English Description
Why
The Qwen3.5/Qwen3.6 Gated DeltaNet path currently uses a fused Gated RMSNorm operator for large-token prefill workloads. After splitting this path into native Ascend RmsNorm, SiLU, and elementwise multiplication, all six end-to-end scenarios improve TTFT and E2E latency. The 35B TP=2 and TP=4 workloads improve E2E latency by 7.35% and 5.49%, respectively.
What changed
XLLM_NATIVE_SPLIT_GATED_RMS_NORM=1; the fused implementation remains the default.rms_norm;gated_layer_normpath for other devices, when the environment variable is unset, or when the shape conditions are not met.USE_NPUso other backends are unaffected.Performance setup
95a3e499674900f6d08cce881d14e31479f14ca1Negative deltas mean lower latency.
Validation
clang-format 20.1.6: passed.git diff --check: passed.