Repository navigation
support indexer_n_heads = 16 - #1
Merged
Merged
Conversation
Signed-off-by: JaredforReal <[email protected]>
There was a problem hiding this comment.
Pull request overview
Enables support for indexer_n_heads = 16 in the SM100 MQA logits kernels by fixing shared-memory/TMA alignment for small per-stage weight tiles and extending TMEM load helpers to handle smaller accumulator widths used by 16-head configurations.
Changes:
- Pad per-stage shared-memory stride for the weights pipeline in SM100 paged MQA logits kernels to satisfy TMA alignment requirements when
num_heads=16. - Extend SM100 TMEM load helper support to include
N=8andN=16element loads (needed for 16-head paths). - Relax API-side head-count validation to allow
num_heads == 16for both paged and non-paged MQA logits.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| deep_gemm/include/deep_gemm/impls/sm100_fp8_paged_mqa_logits.cuh | Pads SMEM weight stage stride for TMA alignment and adds TMEM load sizes for 16-head support. |
| deep_gemm/include/deep_gemm/impls/sm100_fp8_mqa_logits.cuh | Adds TMEM load sizes needed when kNumHeads == 16. |
| deep_gemm/include/deep_gemm/impls/sm100_fp4_paged_mqa_logits.cuh | Pads SMEM weight stage stride for TMA alignment and adds TMEM load sizes needed for 16-head support. |
| deep_gemm/include/deep_gemm/impls/sm100_fp4_mqa_logits.cuh | Adds TMEM load sizes needed when kNumHeads/2 == 8 under 16-head configs. |
| csrc/jit_kernels/impls/smxx_fp8_fp4_paged_mqa_logits.hpp | Updates SM100 shared-memory size calculation to account for 128B-padded weight stage stride. |
| csrc/apis/attention.hpp | Allows num_heads == 16 for FP8/FP4 (paged and non-paged) MQA logits API validation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| static constexpr uint32_t SMEM_KV_SIZE_PER_STAGE = SPLIT_KV * kHeadDim * sizeof(__nv_fp8_e4m3); | ||
| static constexpr uint32_t SMEM_KV_SCALE_SIZE_PER_STAGE = SPLIT_KV * sizeof(float); | ||
| static constexpr uint32_t SMEM_WEIGHT_SIZE_PER_STAGE = kNextNAtom * kNumHeads * sizeof(float); | ||
| // TMA requires 128B - aligned shared memory addresses, so pad the per - stage stride |
| static constexpr uint32_t SMEM_KV_SIZE_PER_STAGE = SPLIT_KV * (kHeadDim / 2); | ||
| static constexpr uint32_t SMEM_SF_KV_SIZE_PER_STAGE = kNumSFKV * sizeof(int); | ||
| static constexpr uint32_t SMEM_WEIGHT_SIZE_PER_STAGE = kNextNAtom * kNumHeads * sizeof(float); | ||
| // TMA requires 128B - aligned shared memory addresses, so pad the per - stage stride |
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.
No description provided.