Skip to content

[executorch][cuda] SDPA: small-query split-K for L_q <= 16 and skip fully masked KV tiles - #25429

Open
Gasoonjia wants to merge 9 commits into
gh/Gasoonjia/136/basefrom
gh/Gasoonjia/136/head
Open

Gasoonjia wants to merge 9 commits into
gh/Gasoonjia/136/basefrom
gh/Gasoonjia/136/head

Conversation

@Gasoonjia

@Gasoonjia Gasoonjia commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

The small-query split-K decode kernel served only 2 <= L_q <= 4. Packed decode of several sequences (one query row per sequence with an explicit cell mask) at 8 or 16 rows fell back to the prefill flash kernel, which sweeps the whole cell pool with one CTA per 64-row block.

The kernel now serves 2 <= L_q <= 16, and it skips KV tiles the mask hides from every row of the block (the prefill kernel's block_active idiom), so cells of sequences outside the step are not loaded. sdpa() routes to it only for a concrete L_q (the launcher bakes L_q as a constexpr, so a symbolic L_q, even one bounded within [2, 16] like the DFlash draft block, keeps the prefill kernel) and only while the per-CTA tile (L_q * next_pow2(GQA groups) rows by head_dim) is at most 256 rows and 256 x 128 elements, the largest shape measured (Muse Glimmer: 16:1 GQA, head_dim 128, in the batching export's static-width forward_{8,16} methods), and while the BF16 query tile plus a 32-key K and V tile fit 99 KB of shared memory (SM86/89/120), and, without a mask, while the tile is at most 64 x 256 elements. Checked config by config on an RTX 5090: a 64 x 512 tile fits no config; without a mask the K/V loads are pipelined and a 128 x 256 tile fits none of the configs the accumulator prune keeps (64 x 256 and 32 x 512 do); with a mask 128 x 256 runs. Those shapes keep the prefill kernel. The budget is fixed, so on A100/H100 it also sends some shapes the base ran on split-K (L_q 3-4 at 16:1 GQA with head_dim 512) to the prefill kernel; unmeasured. Beyond the target's forward_{8,16}, the change also moves the DFlash static packed drafts (draft_forward_{count}, and draft_forward with one owner) to split-K when count x block <= 16, through cell_step with a cell mask; those were not measured separately. Two more BLOCK_N configs (32, 64 with 8 warps) cover the wider row blocks, and the autotuner prunes configs that would hold more than 128 FP32 accumulator values per thread (as the prefill kernel does). The standalone triton::sdpa_small_query_splitk op requires a concrete L_q and applies the same caps (one _small_query_tile_fits helper). The tile skip only pays off when the pool holds cells of sequences outside the step.

Authored with Claude Code.

Differential Revision: D131418681

NOTE FOR REVIEWERS: This PR has internal Meta-specific changes or comments, please review them on Phabricator!

@pytorch-bot

pytorch-bot Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/25429

Note: Links to docs will display an error until the docs builds have been completed.

❌ 3 New Failures, 1 Cancelled Job, 1 Pending

As of commit ade4b84 with merge base 9f49fe2 (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOB - The following job was cancelled. Please retry:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 22, 2026
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@Gasoonjia

Copy link
Copy Markdown
Contributor Author

@claude /pr-review

@claude

claude Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Claude finished @Gasoonjia's task in 21m 50s —— View job


Request Changes: I found no bug that gives wrong output, but three things should change before merge: the ET_CUDA_SDPA_SMALL_QUERY_MAX_LQ knob is read at import and now sets which L_q values a public op accepts, dispatch caps L_q but not the rows per CTA (up to 256 rows, or 128×256 for the Qwen3.5 config), and neither the tile-skip speedup nor the packed test's coverage of it is shown.

PR Review: #25429 (click to expand)

Summary

This PR widens the small-query split-K SDPA kernel from 2 ≤ L_q ≤ 4 to 2 ≤ L_q ≤ ET_CUDA_SDPA_SMALL_QUERY_MAX_LQ (default 16). It also skips KV tiles that no row of the CTA can see.

No wrong-output bug was found: a skipped tile leaves m_i, l_i and acc exactly as computing it would. The problems are:

  • an env var read at import that now defines a public op's contract;
  • a dispatch gate that does not cap the rows per CTA;
  • a tile skip whose cost and benefit are unmeasured;
  • a packed-decode test that cannot tell whether the skip ran.

Nothing was run here (no GPU). Performance points come from reading the code and are marked suspected where unverified.

API Design

  • ET_CUDA_SDPA_SMALL_QUERY_MAX_LQ is read once at import and controls both sdpa() routing and the public op's validation. It is defined at sdpa.py:78 and used at :1401-1403 and :2444-2447.
    • Bad values break the whole backend. A non-integer value raises a bare ValueError that does not name the variable. cuda_backend.py:61 imports the kernels package, which imports sdpa.py (triton/kernels/__init__.py:20), so the whole CUDA backend fails to import.
    • Late settings are ignored. Setting the variable after import has no effect and gives no warning.
    • No range check. 1 makes triton::sdpa_small_query_splitk reject every call. 64 lets L_q=64 blocks (64 × G rows) into a kernel tested only up to 16.
    • Exports depend on the shell. Routing is decided when the model is lowered, so two exports from shells with different values silently produce different .pte files.
    • It matches neither convention nearby. The other thresholds in this file (_SPLITK_LKV_THRESHOLD, _TMA_PREFILL_LKV_THRESHOLD) are plain constants. The other ET_CUDA_* knobs are read when used and fail with an error that names them (triton/kernels/nvfp4_output.py:17-19, quantize_op_dispatch/nvfp4_dispatch.py:242-244).
    • The tests assume the default. test_triton_sdpa_splitk.py:177, :218-219 and :627 hard-code 16, so the suite fails whenever the variable is set.
    • Suggestion: use a plain constant. If a knob is really needed, read it lazily, validate and clamp it, keep the op's validation at a fixed kernel limit, and derive the test bounds from _SMALL_QUERY_MAX_LQ. Fix this →

Testing

  • test_small_query_packed_sequences_skip_masked_tiles neither guarantees nor detects a skip (test_triton_sdpa_splitk.py:259-284).
    • Few tiles are fully hidden. With Lk=2048, _decode_splitk_config gives 16 splits of 128 cells on any GPU with at least 17 SMs.

      • For Lq=8, row i sees [256i+5, 256i+156). No tile is fully hidden unless BLOCK_N ≤ 64.
      • For Lq=16, row i sees [128i+5, 128i+79). Tiles are fully hidden only at BLOCK_N=32.
    • Whether the skip runs depends on the GPU. BLOCK_N is chosen by autotuning on all-visible masks (_visible_mask_scenarios, sdpa.py:57-64).

    • The docstring is wrong. "Most KV tiles … are skipped" (:262) is never true for these shapes; at most about 3/8 of tiles are skipped. The "unused tail" is cut off by kv_len, not by the mask.

    • The test passes without the skip. A skipped tile gives the same output as a computed one, so reverting sdpa.py:2088-2101 still passes.

    • Suggestion:

      • Use hidden gaps wider than 512 cells, raising Lk as needed.
      • Set V to NaN at cells at least 256 from any visible cell, as test_offgraph_kv.py:724-725 does past read_len.
      • Compute the reference from the clean V.

      If a hidden tile is computed, the output turns NaN and the existing isfinite assert fails, so the test then checks the skip. Fix this →

  • No test calls sdpa() with a symbolic L_q (minor; raised by one reviewer). The description gives symbolic L_q as the reason for the statically_known_true change (sdpa.py:1401-1403). If that change were reverted to a comparison that adds a guard, no test would catch it.

Performance

  • Dispatch caps L_q but not the rows per CTA (sdpa.py:1401-1403, :2310, :2361).
    • Accumulator size. One CTA holds all L_q × next_pow2(G) rows of a (b, h_kv) pair, with a [BLOCK_M, HEAD_DIM] fp32 accumulator (:2062-2080). At L_q=16:

      • The 16:1 GQA shape of test_high_gqa_small_query_with_runtime_kv_len gives BLOCK_M=256.
      • The Qwen3.5 config of test_qwen35_config (H_q=16, H_kv=2, D=256) gives a 128×256 accumulator.

      Both are 32K fp32 values: 128 registers per thread at 8 warps for the accumulator alone, 4× the previous maximum. These shapes used to go to the prefill kernel, which spreads rows across CTAs. Heavy register spilling is likely (suspected; not compiled here).

    • Partial-output traffic. The fp32 partials [num_splits, B, H_q, L_q, D] (:2292-2294) also grow 4×. num_splits ignores L_q and kv_len (:2288), and every split writes its partial. Example: B=1, H_kv=2 and a pool of at least 15K cells on a 132-SM GPU give 118 splits. At L_q=16, H_q=32, D=128 that is about 31 MB written and read back on every call, no matter how many tiles were skipped.

    • No coverage or numbers. Every test with L_q > 4 uses G=4 and D ≤ 128 (BLOCK_M ≤ 64), and the PR includes no timings. offgraph_step and cell_step (lower_offgraph_kv.py:221, :267) both call triton.sdpa with kv_len, so every 5–16-row step they lower now uses this kernel.

    • Suggestion: gate dispatch on the rows per CTA (L_q * _next_power_of_2_unclamped(num_groups)) and on D, at a measured threshold, or post numbers showing these shapes beat the prefill kernel. Add L_q=16 correctness tests for G=16 and for D=256. Fix this →

  • The tile skip slows every masked tile, and the repo's own cell-step layout never triggers it (sdpa.py:2088-2101).
    • When a tile is skipped. All rows share one CTA (:2062-2065), so a tile is skipped only when no row in the whole step sees any of its cells.
    • The real layout has no such tiles. cell_step interleaves the step's sequences in one pool and stops the sweep at the occupied extent (lower_offgraph_kv.py:249-256). The repo's model of that step (_cell_inputs, test_autotune_inputs.py:285-303) assigns every cell below kv_len to some row, so nothing is skipped. The description's "most tiles of a packed step are skipped" holds only when the pool has cells that no sequence in the step owns.
    • Added latency. With an explicit mask, the K load now waits for the mask load plus a CTA-wide reduction; in the base kernel the two loads were independent. A dense-mask L_q 2–4 step never skips, so for it the change is pure overhead.
    • Pipelining may be lost. The K/V loads now sit under a data-dependent branch. Triton's pipeliner likely does not prefetch loads inside a branch, so the num_stages=2/3 configs may lose their effect (suspected).
    • Asks: post before/after timings for a dense-mask L_q 2–4 step and for a packed step, and state which pool layouts benefit. If only some callers benefit, gate the skip with a constexpr that the launcher sets.

Code Quality

  • The skip check does not follow the prefill kernel's existing idiom. sdpa.py:614-632 writes block_active = tl.sum(mask_block.to(tl.int32)) > 0, then else: block_active = True, then if block_active:. The new code (:2088-2101) does the same thing with a visible = 1 sentinel, a nested tl.max(tl.max(...)), and if visible > 0:. Fix this →
  • Two routing comments are now out of date. sdpa.py:1375-1377 says "the generalized launcher handles only verifier-sized query blocks". test_offgraph_kv.py:737-738 says split-K is used "only for one, or two to four, query rows". Fix this →

Recommendation

Request Changes. Two changes are needed before merge:

  1. Replace the env-var knob with a constant, or with a validated, clamped lazy read that leaves the op's contract fixed.
  2. Either cap the rows per CTA at dispatch, or show numbers that the wide G/D shapes beat the prefill kernel.

The test and idiom items are small follow-ups.

@Gasoonjia
Gasoonjia deployed to upload-benchmark-results November 23, 2026 00:01 — with GitHub Actions Active
@Gasoonjia

Copy link
Copy Markdown
Contributor Author

Thanks, fixed.

  • test_symbolic_query_length_takes_the_general_kernel now uses 4:1 GQA (H_q=8, H_kv=2, D=128). Every width in [2, 16] then fits the unmasked caps (at most 64x128), and the test asserts _small_query_tile_fits(16 * 4, D, False).
  • Verified on the RTX 5090 by removing the gate: with the isinstance(L_q, int) check deleted from sdpa(), the test fails ("symbolic L_q reached the split-K launcher"). With the check in place it passes.
  • The op's cap error now names the unmasked cap as well.

@Gasoonjia

Copy link
Copy Markdown
Contributor Author

@claude /pr-review

@claude

claude Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Claude finished @Gasoonjia's task in 32m 45s —— View job


Approve: I found no correctness bug. The seven minor items inside are: a possible cost of the tile skip when the mask hides no tile, which nobody has measured; some L_q 2–4 shapes the new caps move to the prefill kernel without the description saying so; three test gaps; a cap check on the unpadded row count; and a stale test comment.

PR Review: #25429 (click to expand)

Summary

This PR sends concrete L_q 2–16 (previously 2–4) to the small-query split-K kernel when the tile fits four caps: rows, elements, shared memory, and elements without a mask. It also skips KV tiles that the mask fully hides. I found no correctness bug, and all seven items below are minor. I ran no code, because the review runner has no GPU, so every point comes from reading the code.

Code Quality

  • The caps are checked on the unpadded row count, not the tile the kernel launches (backends/cuda/triton/kernels/sdpa.py:1429 and :2489, against :2399).
    • _small_query_tile_fits gets L_q * next_pow2(G) rows, but the kernel runs BLOCK_M = next_pow2(L_q * block_g). At L_q 12 with 16:1 GQA, the check sees 192 rows and the kernel runs 256.
    • The comment at :77-78 ("a [rows, HEAD_DIM] FP32 accumulator") is therefore wrong for any L_q that is not a power of 2.
    • The op's error message also reports the unpadded tile. L_q 9 at 4:1 GQA with D=512 is reported as "a 36x512 tile", but the kernel would run 64×512.
    • No routing changes today. The row, element and unmasked caps are power-of-2 bounds, so padding cannot push a tile over them. The shared-memory cap differs only for 33–35 rows at D=512, and no L_q ≤ 16 produces those. A larger shared-memory budget would let a padded tile overflow.
    • Fix: pass _next_power_of_2_unclamped(L_q * block_g) at both call sites. This changes no current routing.
      Fix this →
  • Stale comment (backends/cuda/tests/test_offgraph_kv.py:758-760). It says split-K is covered "with one, then three, query rows". The 16-token step at :764 now also takes small-query split-K; on the base it took the prefill kernel.
    Fix this →

Testing

  • No CI test lowers a concrete 5–16-token width into small-query split-K (backends/cuda/tests/test_offgraph_kv.py:985-1005).
    • Per the description, the target's forward_{8,16} and the DFlash static packed drafts now reach this kernel through cell_step when the pool has at least 256 cells.
    • The Muse Glimmer CI job never takes split-K. Its pools have 128 cells (examples/models/muse-glimmer/tests/test_cuda_batching_pipeline.py:197) or 128 and 80 cells (test_cuda_dflash_packed.py), all below _SPLITK_LKV_THRESHOLD.
    • OffGraphKVCellCompileTest has a 512-cell pool, and its docstring now names the concrete 2..16 branch. It only lowers a one-token method and a symbolic one, though.
    • The other concrete-width tests run eagerly, so CI never lowers these widths through AOTI.
    • Fix: add a static 16-token method to that test, and use a wraps= spy on _SDPA._launch_small_query_splitk to assert that lowering traced it.
      Fix this →
  • The tile-skip test does not cover the widest tiles (backends/cuda/tests/test_triton_sdpa_splitk.py:409).
    • It uses 4:1 GQA at D=128, so the skip is only tested on 32- and 64-row tiles.
    • The widest tiles the caps admit are 256×128 (16:1 GQA, the Muse Glimmer shape) and 128×256 (8:1 GQA, D=256). They only run in test_small_query_widest_tiles_match_reference, whose dense causal masks hide no tile.
      Fix this →
  • The op cap test trips three caps at once and never hits the unmasked cap (backends/cuda/tests/test_triton_sdpa_splitk.py:773-779).
    • L_q 16 at 32:1 GQA with D=128 and a mask is a 512×128 tile. That is over the row, element and shared-memory caps together, so the test still passes if any one check is dropped from the op.
    • The bare assertRaises(RuntimeError) also passes on an unrelated error.
    • This was raised last round. The error message changed, but the test did not.
      Fix this →

Performance

  • The tile skip may slow masked calls that hide no tile (backends/cuda/triton/kernels/sdpa.py:2136-2139).
    • if block_active: puts the K/V loads under a branch that depends on the data. The PR's own comment at :86-88 says this is why masked loads are not software-pipelined.
    • Every masked call loses K/V prefetch as a result, even when every tile is visible. Examples are verify blocks with a dense bottom-right causal mask, and packed steps whose sequences fill the pool.
    • The only data is end-to-end M=1/2/4 steps, and M=1 never reaches this kernel. This point is still open from the last round.
    • Ask: time base against head at L_q 4 with a dense mask and kv_len 4k–32k, using backends/cuda/benchmarks/benchmark_sdpa.py. If head is slower, gate the skip.
      Fix this →
  • The caps move more split-K shapes to the prefill kernel than the description lists (backends/cuda/triton/kernels/sdpa.py:1426-1430). The base gate was if 2 <= L_q <= 4: with no caps.
    • The description names only L_q 3–4 at 16:1 GQA with head_dim 512 on A100/H100.
    • These L_q 2–4 calls also used to go to split-K and now take the prefill kernel. None of them is measured:
      • Without a mask, rows × D above 16384. Examples: L_q 3–4 at 32:1 GQA with D=256, or at 64:1 GQA with D=128.
      • With a mask, over 256 rows or 32768 elements. Examples: L_q 3–4 at 128:1 GQA, or at 64:1 GQA with D=256.
    • Please list them in the description, since it becomes the commit message.

Recommendation

Approve

Nothing blocks merge. The tile-skip benchmark is the most useful follow-up, because a slowdown there would affect every masked call this kernel serves.

@Gasoonjia

Copy link
Copy Markdown
Contributor Author

CI update: the A10G unittest-cuda (system) job hit the 2-hour limit on the top of this stack (NVFP4 tests were ~60 min on A100, more on A10G). This PR's tests now run representative cases by default via sweep(full, quick) in nvfp4_test_utils; the full lists run with ET_CUDA_NVFP4_EXHAUSTIVE_TESTS=1, which the new unittest-cuda-nvfp4-exhaustive job in #25437 sets. No kernel or dispatch code changed in this update. Whole-stack NVFP4 test time on A100: 3582 s -> 752 s.

Authored with Claude Code.

@Gasoonjia

Copy link
Copy Markdown
Contributor Author

@claude /pr-review

@claude

claude Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Claude finished @Gasoonjia's task in 35m 53s —— View job


Approve: I found no correctness bug and nothing that blocks merge. This PR's diff hasn't changed since the last round, and the five minor items inside were all raised before and found again independently this time.

PR Review: #25429 (click to expand)

Summary

This PR sends concrete L_q from 2 to 16 (previously 2 to 4) to the small-query split-K kernel when the tile fits four caps (rows, elements, shared memory, and elements without a mask), and it skips KV tiles that the mask hides from every row. I found no correctness bug, and none of the five items below blocks merge.

The sweep(full, quick) / nvfp4_test_utils change from the latest CI update is not in this PR's diff. The only targets.bzl line added since the last round, the :nvfp4_test_utils dep, came in with the base update, so I did not review it here. All five changed files were covered. Nothing was run, because the runner has no GPU.

Code Quality

  • _small_query_tile_fits is given the unpadded row count (backends/cuda/triton/kernels/sdpa.py:1429, :2489).

    • Both callers pass L_q * next_pow2(G). The kernel's accumulator, however, has BLOCK_M = next_pow2(L_q * block_g) rows (:2399). For example, L_q 12 at 16:1 GQA is checked as 192 rows and launched as 256.

    • Routing is unaffected today only because no reachable row count falls between the shared-memory bound and the next power of two (129–134 rows at head_dim 256, 33–35 at head_dim 512).

    • Three places still describe tiles the kernel never launches:

      • the comment at :77-78;
      • the op's {rows}x{D} error message (:2492);
      • the comment at backends/cuda/tests/test_triton_sdpa_splitk.py:253, which says "a 384x128 tile", but the kernel tile is 512x128.
    • Fix: pass _next_power_of_2_unclamped(L_q * block_g) at both call sites.

    • Separately, the rows * head_dim <= _SMALL_QUERY_MAX_TILE term (:95) never decides routing:

      • at head_dim ≤ 128, the row cap implies it;
      • at head_dim ≥ 256, the shared-memory term already limits every reachable tile to 128 rows (head_dim 256) or 32 rows (head_dim 512).

      Drop the term and its mention in the error message, or add to the comment that it only binds if _SMALL_QUERY_MAX_SMEM grows.

    Fix this →

  • Stale comment (backends/cuda/tests/test_offgraph_kv.py:758-760).

    • The comment says the split-K kernels run "with one, then three, query rows". The 16-token step at :764 now also takes small-query split-K: 32 rows at head_dim 64, over the 512-cell pool.
    • It is the only step in this test where the small-query kernel meets tiles hidden from every row, so it is the step that runs the tile skip against the oracle through cell_step.
    • Wrap both launchers as test_read_len_bounds_both_split_k_kernels does (:746-755) and assert one decode call and two small-query calls. That keeps this step on the small-query path.

    Fix this →

Testing

  • test_small_query_op_rejects_tiles_over_the_cap cannot tell which check fired (backends/cuda/tests/test_triton_sdpa_splitk.py:773-779).

    • Its masked 512x128 tile trips the row, element and shared-memory caps at once.
    • The bare assertRaises(RuntimeError) passes on any RuntimeError the op raises.
    • No test reaches the op's unmasked cap (the attn_mask is None case).
    • Use one subtest per cap, each with assertRaisesRegex(RuntimeError, "tile exceeds"):
      • rows only: L_q 16, H_q 64, H_kv 2, D 64, with a mask;
      • shared memory only: L_q 8, H_q 32, H_kv 4, D 512, with a mask;
      • unmasked cap only: L_q 16, H_q 16, H_kv 2, D 256, no mask.

    Fix this →

Performance

  • Splits with nothing visible still write and re-read a full FP32 O partial (suspected, not measured) (backends/cuda/triton/kernels/sdpa.py:2200, :2286).

    • num_splits comes from the buffer length (_decode_splitk_config(L_kv, ...), :2326), so it does not depend on kv_len or L_q.
    • Each split stores acc for every valid row, even rows whose running max is still -inf. That covers chunks past kv_len, fully hidden tiles, and, in packed decode, most rows of most chunks.
    • The reduce then loads O for every split (masked only by s_valid), even though alpha is 0 for those rows.
    • Example: take the measured Muse Glimmer shape (L_q 16, 32 query heads over 2 KV heads, head_dim 128) on a 170-SM RTX 5090 with a pool of 16K cells or more.
      • The launcher uses 128 splits, which write 32 MiB of partials and read 32 MiB back per layer per step.
      • At a read_len of 2K, the live K/V is only 2 MiB.
    • Fix: store O only where m_i > -inf, and load it only where s_valid & (m > -inf).
    • Question: which pool size and read_len were the "measured faster than the prefill kernel" numbers taken at?

    Fix this →

  • The caps send more of the base's split-K shapes to the prefill kernel than the description says.

    • The description names only the shared-memory budget on A100/H100 (L_q 3–4 at 16:1 GQA, head_dim 512).
    • The unmasked cap (sdpa.py:97) does the same on every GPU. It hits tiles that fit the base's 2/4-warp, single-stage BLOCK_N 32 configs even on 99 KB parts. It also covers causal-only calls, because is_causal with kv_len leaves HAS_MASK false. Examples:
      • L_q 3–4 at 17–32 query heads per KV head, head_dim 256;
      • L_q 3–4 at 33–64 query heads per KV head, head_dim 128 (for example, MQA verify blocks);
      • L_q 2 at 33–64 query heads per KV head, head_dim 256.
    • At head_dim ≤ 64, the row cap does the same for L_q 3–4 above 64 query heads per KV head, with or without a mask.
    • These shapes are unmeasured as well. List them in the description.

Recommendation

Approve

Nothing blocks merge. The items are:

  • comment and error-message accuracy;
  • the precision of the cap test;
  • two unmeasured performance points: partial-buffer traffic on large pools, and base shapes moved to the prefill kernel.
  • Gather context
  • Run three independent reviewers
  • Consolidate findings
  • Fact-check findings
  • Post review

This branch was successfully deployed

1 active and 1 inactive deployments
upload-benchmark-results — ade4b84d Deployed Nov 23, 2026 by Gasoonjia via upload-benchmark-results #23168
cadence — ade4b84d Deployed Nov 23, 2026 by Gasoonjia via hifi-op-test / hifi4 #40341
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant