17Sketch a paged attention kernel. What changes from FlashAttention once the KV cache is not contiguous?▼hardNewTogether AIvLLM4 replies○ sign inThe KV for one sequence is scattered across fixed-size pages, so the kernel reads a table of physical block numbers before it can read any keys. What the indirection costs, what the table costs in memory, why decode must split the KV dimension across thread blocks, and how the partial softmax states combine.Open full answer →
14Implement the block allocator behind a paged KV cache, including prefix sharing and copy-on-write.▼hardNewvLLMTogether AI4 replies○ sign inA free list, a per-sequence block table, and a reference count are the whole structure. What forking costs, why the first write after a fork must copy, and the measured waste that this design accepts in exchange for eliminating the far larger waste of pre-allocation.Open full answer →