vllm
vllm copied to clipboard
[Misc]: Implement SlidingWindowBlockTable in BlockManagerV2
Recently, we refactored the block manager subsystem to improve testability by separating concerns of each layer. See https://github.com/vllm-project/vllm/pull/3492 for more information.
The V2 implementation does not yet have sliding window support. This issue tracks adding sliding window to the V2 block table so that we can support models that use this feature.
My initial take on the design is to implement a SlidingWindowBlockTable
that composes within it a BlockTable
. The SlidingWindowBlockTable
will then drop blocks that are outside of the context window (potentially mapping them to a devnull block). This will preserve the semantics of the v1 block manager sliding window while fitting into the new design.
I'd like to take a look on this.
I would be willing to work on this if its up for grabs.
@Kaiyang-Chen I guess they want to separate the concerns by splitting the codes in multiple classes.
We'll want to prioritize this soon so that we can deprecate the V1 block manager. cc @ruthe98 @rkooo567 @mmoskal.
I made a little progress here - in particular it's not enough to just remove blocks from the beginning of block table - we'll have to replace them with some placeholders
Yeah, I think we can take inspiration from a devnull or zero block used in operating systems