[KMCompiler] [ttx/npu] add DeepSeek-V4 operator rms_norm_dynamic_quant - #416
[KMCompiler] [ttx/npu] add DeepSeek-V4 operator rms_norm_dynamic_quant#416YangLong114514 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces MojoRMSNormDynamicQuant, a fused RMSNorm and dynamic per-token quantization operator, along with its TTX backend implementation and corresponding Triton kernels for NPU. The feedback highlights critical issues in the Triton kernels, specifically potential out-of-bounds memory writes in unmasked kernels when the hidden dimension is not aligned to BLOCK_N_ALIGN. Additionally, the reviewer recommends adding division-by-zero guards in the prefill kernels and utilizing propagate_nan=tl.PropagateNan.ALL in tl.max operations to prevent performance overhead and align with NPU hardware behavior.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Description
Add TLE Triton implementation of MojoRMSNormDynamicQuant for DeepSeek-V4 on Ascend 910B.
Changes
Performance
Test environment: Ascend 910B, TLE Triton backend.(cann 9.0)
The above perf data was obtained from testing using the perf-rms_norm_dynamic_quant.py.py script.
Accuracy Test
All accuracy test cases passed.