Repository navigation
Conversation
[ghstack-poisoned]
🔗 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 PendingAs of commit ade4b84 with merge base 9f49fe2 ( 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. |
This PR needs a
|
|
@claude /pr-review |
|
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 PR Review: #25429 (click to expand)SummaryThis PR widens the small-query split-K SDPA kernel from 2 ≤ L_q ≤ 4 to 2 ≤ L_q ≤ No wrong-output bug was found: a skipped tile leaves
Nothing was run here (no GPU). Performance points come from reading the code and are marked suspected where unverified. API Design
Testing
Performance
Code Quality
RecommendationRequest Changes. Two changes are needed before merge:
The test and idiom items are small follow-ups. |
[ghstack-poisoned]
|
Thanks, fixed.
|
|
@claude /pr-review |
|
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)SummaryThis 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
Testing
Performance
RecommendationApprove 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. |
[ghstack-poisoned]
|
CI update: the A10G Authored with Claude Code. |
|
@claude /pr-review |
|
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)SummaryThis 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 Code Quality
Testing
Performance
RecommendationApprove Nothing blocks merge. The items are:
|
[ghstack-poisoned]
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_activeidiom), 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}, anddraft_forwardwith one owner) to split-K when count x block <= 16, throughcell_stepwith a cell mask; those were not measured separately. Two moreBLOCK_Nconfigs (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 standalonetriton::sdpa_small_query_splitkop requires a concrete L_q and applies the same caps (one_small_query_tile_fitshelper). 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!