vllm icon indicating copy to clipboard operation
vllm copied to clipboard

[Misc]: Implement SlidingWindowBlockTable in BlockManagerV2

Open cadedaniel opened this issue 10 months ago • 6 comments

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.

cadedaniel avatar Mar 27 '24 21:03 cadedaniel

I'd like to take a look on this.

Kaiyang-Chen avatar Apr 06 '24 21:04 Kaiyang-Chen

I would be willing to work on this if its up for grabs.

mory91 avatar Apr 09 '24 00:04 mory91

@Kaiyang-Chen I guess they want to separate the concerns by splitting the codes in multiple classes.

mory91 avatar Apr 09 '24 00:04 mory91

We'll want to prioritize this soon so that we can deprecate the V1 block manager. cc @ruthe98 @rkooo567 @mmoskal.

cadedaniel avatar May 01 '24 19:05 cadedaniel

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

mmoskal avatar May 01 '24 21:05 mmoskal

Yeah, I think we can take inspiration from a devnull or zero block used in operating systems

cadedaniel avatar May 01 '24 21:05 cadedaniel