LSA (latent sparse attention) for RTX decode at long ctx — watch #351

Open
opened 2026-11-05 09:37:23 +01:00 by orchestra · 0 comments
Member

Track Latent Sparse Attention (https://github.com/Prefrontal-AI/latent-sparse-attention). Low priority, by owner decision 2026-11-05. Evaluation: draft PR #350 (docs/research/latent-sparse-attention.md). Verdict: WATCH.

What it is: query-dependent key selection in the 16 full-attention layers. Each query reads the first 4 tokens, the last 512 tokens, and the top 4096 keys chosen through ~8-key cluster matching. It is exact dense attention below ~4.6k tokens. The trained 64-dim projections for Qwen3.8-27B base are released (bf16), and there is a training-free variant. Apache-2.0.

Expected gain: RTX decode at 32k+ only. Estimated +5…+20% TG at B4/B8 32k, with a best case of +29% at B8 32k, which is still under 100 tok/s/user. Nothing for TT prefill or for the P/D handoff bytes. The KV pool shrinks by 5–23% because of the index.

Blockers:

  • The only implementation is an SGLang-fork plugin that refuses fp8 KV, paged KV and spec decode, all of which we use.
  • A vLLM 0.32 port is estimated at 4–6 engineer-weeks: a FlashInfer-wrapped sparse backend, CUDA graphs, MTP verify positions, index reuse on prefix and offload hits, and two extra all-reduces per layer at TP=4.
  • It is not bit-exact past ~4.6k tokens, so it needs retrieval 16k/32k, agent-sessions and a long-context coding gate.

Reopen when:

  • the CPU experiment below passes, or
  • an upstream vLLM backend lands, or
  • B8 32k is still under target after the exact dense-attention fixes, i.e. the profiler work on attention running at ~35% of its bandwidth roofline.

Cheapest experiment (CPU/EPYC only):

  1. Run a bf16 ThinkingCap forward at 32k and capture Q/K of the attention layers.
  2. Apply the released projections, plus a PCA fit on our own keys, through a ~200-line reimplementation of the selection.
  3. Measure the selected attention-mass coverage, the attention-output error, the next-token logit KL and top-1 agreement, with and without a shared list across the verify positions.
  4. Prototype only if coverage is ≥0.95 and top-1 agreement holds.
Track Latent Sparse Attention (https://github.com/Prefrontal-AI/latent-sparse-attention). **Low priority, by owner decision 2026-11-05.** Evaluation: draft PR #350 (`docs/research/latent-sparse-attention.md`). Verdict: **WATCH**. **What it is:** query-dependent key selection in the 16 full-attention layers. Each query reads the first 4 tokens, the last 512 tokens, and the top 4096 keys chosen through ~8-key cluster matching. It is exact dense attention below ~4.6k tokens. The trained 64-dim projections for Qwen3.8-27B base are released (bf16), and there is a training-free variant. Apache-2.0. **Expected gain:** RTX decode at 32k+ only. Estimated +5…+20% TG at B4/B8 32k, with a best case of +29% at B8 32k, which is still under 100 tok/s/user. Nothing for TT prefill or for the P/D handoff bytes. The KV pool shrinks by 5–23% because of the index. **Blockers:** - The only implementation is an SGLang-fork plugin that refuses fp8 KV, paged KV and spec decode, all of which we use. - A vLLM 0.32 port is estimated at 4–6 engineer-weeks: a FlashInfer-wrapped sparse backend, CUDA graphs, MTP verify positions, index reuse on prefix and offload hits, and two extra all-reduces per layer at TP=4. - It is not bit-exact past ~4.6k tokens, so it needs retrieval 16k/32k, agent-sessions and a long-context coding gate. **Reopen when:** - the CPU experiment below passes, or - an upstream vLLM backend lands, or - B8 32k is still under target after the exact dense-attention fixes, i.e. the profiler work on attention running at ~35% of its bandwidth roofline. **Cheapest experiment (CPU/EPYC only):** 1. Run a bf16 ThinkingCap forward at 32k and capture Q/K of the attention layers. 2. Apply the released projections, plus a PCA fit on our own keys, through a ~200-line reimplementation of the selection. 3. Measure the selected attention-mass coverage, the attention-output error, the next-token logit KL and top-1 agreement, with and without a shared list across the verify positions. 4. Prototype only if coverage is ≥0.95 and top-1 agreement holds.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitpartner/tt-stack#351
No description provided.