Add interleave mode for split qkv norm rope#503
Merged
iforgetmyname merged 2 commits intoMay 27, 2026
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support for interleaved Rotary Positional Embeddings (RoPE) alongside the existing Neox-style implementation by adding an is_neox_style parameter and adjusting slicing and insertion logic with strides. The review feedback highlights several improvement opportunities: specifically, the use of hardcoded bfloat16 for intermediate tensors should be replaced with the input's native dtype to maintain precision, the duplicated logic between Query and Key blocks should be refactored to improve maintainability, and the new functionality should be extended to the Gemma-style kernel for consistency.
5 tasks
iforgetmyname
approved these changes
May 27, 2026
1329009851
added a commit
to 1329009851/sgl-kernel-npu
that referenced
this pull request
May 29, 2026
* 'main' of https://github.com/1329009851/sgl-kernel-npu: added new commands to README for DeepEP (sgl-project#514) feat: pto mega-gdn support dynamic num heads (sgl-project#517) [NPU][Feat] Add alltoall mode on deepep (sgl-project#508) support torch_memory_saver preload hook_mode (sgl-project#463) DeepEP: expand moe specifications (sgl-project#515) refactor: separate submodule init and build, remove cuda deps from CI (sgl-project#516) Add interleave mode for split qkv norm rope (sgl-project#503)
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.
As mrope support rotary mode interleaved, which use interleaved data to compute x, https://www.hiascend.com/document/detail/zh/Pytorch/2600/apiref/torchnpuCustomsapi/docs/zh/custom_APIs/torch_npu/torch_npu-npu_mrope.md, this pr was proposed to align with different scenes of mrope, interleaved and half.