HuggingFace naive
model.generate() behind a lock · one request at a time
model.generate() behind a lock · one request at a time
continuous batching · PagedAttention · same weights
Pick a number of concurrent users and start the race.
each request reserves max_len up front, in one piece
16-token blocks, allocated on demand, anywhere
Same GPU memory, same request stream on both sides. A block table maps each sequence's logical blocks to physical ones, exactly like an OS page table, so memory is claimed only when a token actually exists. Waste is bounded by one partial block per sequence, and identical prefixes can share blocks copy-on-write.
batch is fixed at admission; everyone waits for the longest sequence
the batch is re-formed every decode step; a finished slot is refilled immediately
Each row is one slot of the GPU batch, time runs left to right in decode steps. The naive HuggingFace server in the race is the limiting case: one slot. Paging is what makes this cheap: admitting a request mid-flight only needs a few free blocks, not a contiguous slab.
one figure per user · fills up as their answer is written