frost(sdpa): retire Capabilities.bottom_right_padded_seq_q - #683
Conversation
Signed-off-by: Haobin Guo <haobing@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (11)
💤 Files with no reviewable changes (2)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 WalkthroughWalkthroughSM100 SDPA now supports dense bottom-right causal execution with per-batch query lengths. Kernel bounds, correction paths, references, graph eligibility, and tests now use per-batch lengths and handle dead query rows. ChangesSM100 padded-query causal execution
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to The PR provides a localized SM100 SDPA correctness fix with targeted regression coverage; no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant SDPA_Graph
participant SM100_Validation
participant Prefill_Kernel
participant _resolve_seqlen_q
participant Output_Correction
SDPA_Graph->>SM100_Validation: validate bottom-right causal graph
SM100_Validation-->>SDPA_Graph: accept per-batch query lengths
SDPA_Graph->>Prefill_Kernel: launch with seq_q_lens_tensor
Prefill_Kernel->>_resolve_seqlen_q: resolve effective Q bounds
_resolve_seqlen_q-->>Prefill_Kernel: return clamped per-batch Q length
Prefill_Kernel->>Output_Correction: process tile output
Output_Correction-->>Prefill_Kernel: zero empty-KV tiles
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@cudnn-ci-bot run frost |
|
🚀 Running mirror pipeline Branch: cudnn-gh/pr-683-11ff5d7 |
Before submitting
pre-commit runand committed any formatting changes.cat-*, one or moremod-*, and oneorig-*(see label list).Affected area
Summary
seq_len_q, the BR diagonal now correctly anchors at(seq_len_q[b], seq_len_kv[b])per cuDNN semantics instead of the globalS_qfor SM100-family SDPA engines; with the gap closed, we can retireCapabilities.bottom_right_padded_seq_q0 * garbage = 0to zero rows whose KV loop was empty or collapsed, but the O TMEM is unwritten for such tiles and0 * inf = NaN(pre-existing bug)Why
To close kernel gap and retire
bottom_right_padded_seq_qfor cleaner capability declaration.Related issues
Related to #379.
API and compatibility impact
seq_len_qnow route to FROST on SM100 instead of native cuDNN.const_expr-folded — specializations withoutSEQ_Q_LENS_PRESENT+BOTTOM_RIGHT(diagonal) or withoutMAY_BE_EMPTY(zero-store) compile identically; the zero-store guard is one warp-uniform branch per tile otherwise. No compile-key or ABI change.seq_len_q[b] < S_q.Testing
On B200-class SM100 (cc 10.0), cuDNN backend 9.20, CUDA 13.0, torch 2.13, from
test/python:pytest sdpa/frost/test_sdpa_graph_analyzer.py— 84 passed (includes the inverted probe test, nowtest_probe_accepts_bottom_right_with_padded_seq_len_q).pytest sdpa/frost/test_sdpa_fwd_dsl_sm100.py sdpa/frost/test_sdpa_fwd_split_kv_sm100.py— 533 passed, 3 failed:thd_cu_seq_len*, pre-existing on this 9.20 backend (cu_seq_len ports need 9.24+; identical failures on pristine develop).test_dsl_sm100_graph_api_padded_bottom_right_gqa(formerly-declined graph shape end to end),test_dsl_sm100_bottom_right_padded_seq_q(4 flavors, BR+SWA+GQA+LSE, mid-tile trim / zero-length / collapsed tiles, dead rows asserted exactly zero);test_split_kv_padded_q_trimextended to d128+d512 withS_q=1024so collapsed tiles exist (regression for the zero-store fix, top-left).seq_len_q; BR, top-left, and top-left+SWA forms): 3/3 NaN before — also 3/3 on pristine develop, proving pre-existence — 9/9 clean after.Summary by CodeRabbit
New Features
Bug Fixes
Documentation