Skip to content

[Kernel] Expand SM70 75T prefill to Q8192 and concurrent requests - #635

Merged
yangzhuxinyzx merged 1 commit into
mainfrom
codex/v100-79t-q8192-concurrency-20260914
Sep 14, 2026
Merged

yangzhuxinyzx merged 1 commit into
mainfrom
codex/v100-79t-q8192-concurrency-20260914

Conversation

@yangzhuxinyzx

Copy link
Copy Markdown
Contributor

Purpose

The default SM70 75-TFLOP/s long-prefill path only admitted Q8000 with a single-request paged-gather gate and an 8000-token KV step. That kept normal Q8192 chunks and concurrent scheduler batches off the optimized path.

This change adds a native Q8192 FP16 Tensor Core / FP32 MMA-accumulation specialization, dispatches Q8001-Q8191 by causality-preserving leading padding, and removes the single-request admission gate. Each eligible request in a scheduler batch now gathers paged KV into the reusable dense workspace and enters the same architecture path. The admitted KV range is Q through 262144 with 32-token alignment; boundary testing showed that smaller prefix PV remainders remain finite but are numerically invalid, so those shapes keep the general fallback.

The two-request end-to-end run also exposed an existing E4M3 batched-XQA planner mismatch: the Python planner could choose partition 1024 although the native B2-B16 kernel accepts 64/128/256. Automatic batched E4M3 planning is now capped at 256, while incompatible explicit overrides fail clearly.

Test Plan

  • Build the SM70 FA2 extension from source and verify the Q8000 and Q8192 operators are registered.
  • Benchmark Q8192 at aligned 128K and 256K-class KV lengths with 30 warmups and 100 CUDA-event samples.
  • Compare sampled rows against an FP32 attention reference and run overflow/stability inputs.
  • Run one 256K cold TP4 request and two concurrent 128K cold TP4 requests with prefix caching disabled and E4M3 KV.
  • Run the SM70 route-policy, decode-planner, and CUDA stability suites.
  • Run all pre-commit hooks on the changed files.

Test Result

  • Final FA2 SHA256: 9f55da1ae54d87b008cb3452e23e1e4b272dd66115d37620d63674f3841c0055.
  • Q8192 operator throughput:
    • KV128000: 76.7010 TFLOP/s, relative L2 0.2387%.
    • KV128032: 75.6171 TFLOP/s, relative L2 0.2350%.
    • KV256000: 75.8294 TFLOP/s, relative L2 0.2607%.
    • KV262144: 75.5520 TFLOP/s, relative L2 0.2290%.
  • All sampled outputs were finite. KV=Q+8/+16/+24 boundary probes exposed incorrect partial PV tiles and are now rejected; KV=Q and Q+32 passed.
  • One cold 256000-token TP4 request: 96.9743 s TTFT, 2639.88 prompt tok/s, zero cached tokens, and the exact same 16 output token IDs as the Q8000/control run.
  • Two concurrent cold 128000-token TP4 requests: 74.2707 s batch TTFT and 3446.85 aggregate prompt tok/s over 256000 input tokens. Both requests had zero cached tokens and returned the same complete answer. Every TP rank recorded 448 native Q8192 calls and 480 E4M3 bridge calls.
  • pytest: 172 passed.
  • Pre-commit: all hooks passed, including Ruff, clang-format, markdownlint, mypy, SPDX, and DCO sign-off.

Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
@yangzhuxinyzx
yangzhuxinyzx marked this pull request as ready for review September 14, 2026 11:45
@yangzhuxinyzx
yangzhuxinyzx merged commit a6f5e83 into main Sep 14, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant