Skip to content

support indexer_n_heads = 16 - #1

Merged
zyongye merged 1 commit into
vllm-project:mainfrom
JaredforReal:main
Jun 26, 2026
Merged

zyongye merged 1 commit into
vllm-project:mainfrom
JaredforReal:main

Conversation

@JaredforReal

Copy link
Copy Markdown

No description provided.

Signed-off-by: JaredforReal <[email protected]>
Copilot AI review requested due to automatic review settings June 26, 2026 07:06
@zyongye
zyongye merged commit d67f845 into vllm-project:main Jun 26, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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=8 and N=16 element loads (needed for 16-head paths).
  • Relax API-side head-count validation to allow num_heads == 16 for 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants