Chunk 66.0

In this chunk, the assistant completed the 200k context-length deployment on the CT200 server, adjusting `mem-fraction-static` to 0.94 and `max-running-requests` to 8 to achieve a KV pool of 218k tokens. A comprehensive long-context benchmark (1k–185k tokens) revealed severe decode slowdown (0.7 tok/s at 185k) with GPU tensor core utilization at only ~3% during decode, despite 99.8% SM occupancy reported by nvidia-smi. The user correctly questioned this performance, suspecting drafter issues and low GPU utilization. The assistant investigated thoroughly: confirmed the drafter's sliding-window attention and KV caching work correctly (commit length stays 7–8 at all context lengths with predictable text), and identified the root cause as the DDTree verify attention being locked to Triton MLA with `page_size=1`, causing scattered KV access at ~14 GB/s effective bandwidth—130× below the 1.8 TB/s peak. The `commit_len=1` observed in benchmarks was purely text difficulty, not a bug. The user then directed investigation into optimized kernel integration and K/V defragmentation. The assistant discovered that all optimized MLA kernels (FlashMLA, cutlass-MLA, flashinfer-MLA) are compiled only for sm_90a/sm_100a/sm_103a—none support sm_120 (RTX PRO 6000 Blackwell consumer), and they use Hopper/Blackwell-DC instructions (wgmma/TMA/tcgen05) that don't exist on sm_120's Ada-like ISA. The user approved building an owned sm_120 kernel, noting the smaller 100KB shared memory constraint. The assistant wrote a detailed per-phase plan (`plans/0002-sm120-verify-kernel-defrag.md`) and implemented Phase 1: a KV-split flash-decode MLA verify kernel (`verify_attn_flash.cu`) with a partial+reduce design to improve occupancy. The kernel passes token-exact correctness tests against the naive oracle, but initial microbenchmarks show it's still slower than naive at short prefixes (0.4–0.7×) and only modestly faster at longer ones (1.7–2.0×), indicating the reduction kernel and tile sizing need further optimization for sm_120's architecture. The work continues toward the custom SGLang backend and K/V defrag phases.

From 0.7 tok/s to 3-6× Speedup: The Custom Kernel Journey That Rescued Long-Context Decode on Blackwell GPUs 2713 words

Message Articles