Which attention kernels can run long-context attention on which hardware: the SM-level gate on whether long context is servable at all
Fields
flops/ctx-long-context-attention-kernel-matrixNotes
WHAT THIS RECORD ADDS TO THE REPO'S EXISTING KERNEL RECORDS. [[attn-regime-map-context-batch]] already maps which kernel wins by context length and batch size and already records the measured throughput per FA generation (FA-2 50-73 percent of peak on A100, FA-3 740 TFLOP/s FP16 and about 1.2 PFLOP/s FP8 on H100, FA-4 1605 TFLOP/s BF16 on B200, FlashInfer 28-30 percent latency reduction for long context, FlashMLA 1024 TFlops decode and 1350 TFlops sparse prefill on B200). [[attn-mla-kernel-support-matrix]] already records that FlashMLA is SM100/SM103 with CUDA >= 13.1, that the 2026.09.30 release removed Hopper support, and that FlashMLA's decode supports only FP8 and FP4 KV. What was missing is the per-hardware ANSWER to 'can I serve long context on this card at all', stated as a fleet-level constraint rather than as per-kernel notes: SM80 has FA-1/FA-2 only; SM90 has FA-3 and a pinned FlashMLA; SM100/103 has FA-4 and current FlashMLA with fp8/fp4 KV mandatory. THE FORMAT CONSTRAINT IS THE PART THAT BITES. FlashMLA hard-codes its KV cache layout - 528 bytes/token for FP8 (512 bytes of float8_e4m3 covering all 512 dims, so the 64 RoPE dims are quantized too, plus 16 bytes of float8_e8m0 scales, one per 32 consecutive e4m3 values) and 288 bytes/token for FP4 (256 bytes of e2m1, two per byte, plus 32 bytes of float8_e4m3 scales, one per 16 e2m1, valid only for extra_k_cache when k_cache is in the V4.1 format). A kernel that hard-codes the KV format will not accept another engine's cache, so swapping attention backends across a PD-disaggregated deployment means the KV handoff is not a byte copy. And because bf16 is excluded from FlashMLA decode, an operator who wants MLA on Blackwell cannot keep an unquantized cache even if capacity would allow it. THE HEAD_DIM AXIS IS THE ONE MOST DEPLOYMENTS HIT. Two independent head_dim-256 penalties exist and they compound: FlashInfer will not start for head_dim 256/512, and fp8 KV at head_dim 256 raises the TTFT quadratic coefficient 6.93e-07 -> 1.12e-06 ms/token^2, about 1.6x slower prefill. Meanwhile vLLM's --kv-cache-dtype-skip-layers is the lever for hybrid architectures: models like gpt-oss-20b (sliding window 128) and gemma-4-E2B (sliding window 512) have bounded KV in those layers, so quantizing them pays overhead for no long-context saving, and skipping them is measurably better on both accuracy-preserving and throughput grounds. WHY SPLIT-KV IS THE OTHER HALF OF THE ANSWER, and it is what makes 128K decode tolerable at all: at batch 1, decode attention over a large KV cache has too little work to fill the SMs, so the kernel splits the KV dimension across SMs; the repo's regime map calls split-KV essential for long context with small batch and unnecessary above batch 32, and FlashInfer's load-balanced scheduling adjusts the split to dynamic batch size. PREREQUISITE CAVEAT: all of this assumes the KV cache fits. A kernel gate is irrelevant if the card cannot hold the cache - see [[ctx-kv-cache-gib-at-claimed-context]] for the memory precondition, which fails first for any model above about 35B on a single H100.
HARDWARE-PARAMETER ROWS ADDED 2026-10-05 (schema authority pass, agent w5-schema). `affected_by_hardware` names PRODUCTS (accelerator record ids); these rows name the hardware QUANTITIES that move this class's cost, which had nowhere to live until flop.hardware_parameters was added in this commit. Every effect below is lifted verbatim from this record's own existing prose and no figure here is new - `magnitude` reproduces numbers the record already quoted. `basis` is 'unverified' where the effect was asserted with nothing concrete behind it, rather than being dressed up. The rows were pulled out of free-text notes; they are not a change to what this record claims.