v05_decode_slots
What This Version Introduces
This version adds fixed decode slots. Running decode requests are assigned stable slot IDs, and decode inputs can be shaped around the maximum number of slots.
Why Introduce It
Continuous batching makes the active request set dynamic. CUDA Graph and static decode buffers need the opposite: stable shapes and predictable tensor addresses.
Decode slots are the bridge between those worlds.
Core Principle
A slot is a stable position in the decode batch. A request can enter a slot, generate tokens over multiple steps, then release the slot when it finishes.
The engine can build decode tensors sized by max_decode_slots, while an active mask or dummy tokens represent unused slots.
Files To Compare
scheduler.pyfor slot assignment and release.engine.pyfor fixed-width decode input construction.forward_params.pyfor slot metadata.layer/gqa.pyfor decode attention indexed by slot/request mapping.
Remaining Tradeoff
Slots add bookkeeping and may carry inactive lanes. That is the price of making the decode step more static.