[pretuned] Optimize fused_qk_norm_rope on B200 - #3213
Draft
yushangdi wants to merge 1 commit into
Draft
Conversation
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Shangdi Yu <shangdiy@meta.com>
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.
Summary
Optimize the pretuned
fused_qk_norm_ropekernel for full rotary dimensions and synchronize its B200 heuristic with vLLM PR vllm-project/vllm#50466.For
rotary_dim == head_dim, the kernel now:The emitted full-rotary Triton contains 2 QKV loads, 2 QKV stores, and no
tl.debug_barrier().Partial rotary dimensions retain the existing full-head normalization path because RMSNorm must also update the non-rotary tail.
Config changes
Related work and duplicate check
This is not a duplicate of #3081. That PR fixed the general correctness hazard by inserting a barrier for intra-loop store-to-load dependencies. This PR removes that dependency from the common full-rotary kernel path, eliminating both the QKV store/reload and the barrier while preserving #3081 as the compiler-level safety mechanism for kernels that still require such dependencies.
Searches for
fused qk norm rope,store forwarding, andredundant store loadfound no other open Helion PR implementing this dataflow or these B200 schedules.Tests
Results:
1 passed1 passed21/21wins,1.3021xgeomean,1.6855xbest speedupgit diff --check: passed./lint.shcould not run because Ruff/Pyrefly are not installed in this checkout, and repository instructions prohibit networked installs. Offline cached Ruff passed; Pyrefly remains an unrun test gap. H100 structural schedules are retained, but H100 performance was not rerun after changing the memory-operation indexing policy.AI assistance
AI assistance was used to inspect generated Triton, develop and validate the kernel dataflow, tune B200 schedules, and draft this description. The human submitter must review the changes and results before requesting review.