Repository navigation
[CK] [Bugfix] Align batch prefill full-attention dispatch - #6990
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
There was a problem hiding this comment.
🔵 Needs a closer look
Kernel availability and numerical correctness still require a successful GPU run of the batch-prefill tests on the current PR head.
No open issues 🎉
What changed in this PR
This PR aligns Python and C++ batch-prefill dispatch to prevent no matching kernel found errors for full attention with oversized windows or virtual sinks, without changing kernel arithmetic or the public API.
Changes:
- Normalize oversized windows before selecting the Python specialization.
- Route full attention with virtual sinks through CK’s existing unlimited-window mask specialization.
- Add 24 BF16 regression cases to pytest and the standalone GPU CI entry point.
| File | Description |
|---|---|
op_tests/test_batch_prefill.py |
Extends the attention reference and adds full-attention regression coverage. |
csrc/py_itfs_ck/mha_batch_prefill_kernels.cu |
Selects the masked specialization for full attention with virtual sinks. |
aiter/ops/mha.py |
Aligns window normalization and mask/sink specialization selection with C++. |
Review effort: Balanced
3b3c6f4 to
e2908f1
Compare
Normalize windows before choosing the Python specialization and route virtual sinks through CK's existing unlimited-window mask kernels. Keep full attention independent of streaming sink_size and cover the previously failing dispatches with numerical regression tests. Signed-off-by: Yuedong Wu <[email protected]>
e2908f1 to
dee53cb
Compare
Normalize windows before choosing the Python specialization and route virtual sinks through CK's existing unlimited-window mask kernels. Keep full attention independent of streaming sink_size and cover the previously failing dispatches with numerical regression tests. Signed-off-by: Yuedong Wu <[email protected]>

Motivation
Batch prefill can fail with
no matching kernel foundwhen a noncausal window covers the entire KV sequence or when full attention includes a virtual sink. This is to address two pre-existing issues identified during review of PR 6760: #6760 (comment), #6760 (comment)Technical Details
Streaming
sink_sizeremains irrelevant to full attention. Kernel arithmetic and the public API are unchanged.Test Plan
Add 24 BF16 numerical regression cases covering single/multi-query attention, unequal request lengths, shuffled pages, GQA, per-head virtual sinks, oversized windows, and causal/local controls.
The cases run through the existing standalone GPU CI entry point and can also be run with:
Test Result
Local checks passed for 512 dispatch combinations and 24 fixture comparisons against an independent CPU FP64 reference.
GPU validation in CI are passed. The current PR head has a successful GPU run of
op_tests/test_batch_prefill.py.Submission Checklist