vllm.v1.kv_cache_layout ¶
Physical KV cache layout descriptor.
A leaf module so vllm.config can import the enum without pulling in the full KV cache interface.
Classes:
-
KVCacheLayout–Physical layout descriptor for a KV cache group.
KVCacheLayout ¶
Bases: Enum
Physical layout descriptor for a KV cache group.
The logical shape is always [L, B, H, N,
Attributes:
-
is_block_compact(bool) –True when each page's [H, N, C] bytes form one contiguous run; i.e.
-
is_block_contiguous(bool) –True when [H, N, C] is contiguous within a block.
-
is_block_outermost(bool) –True when B is the outermost physical dimension.
-
is_layer_compact(bool) –True when the layer is compact; i.e. the L dimension is outermost.
-
layer_view_order(tuple[int, ...]) –Physical axis order of a logical 4D per-layer cache view.
Source code in vllm/v1/kv_cache_layout.py
is_block_compact property ¶
True when each page's [H, N, C] bytes form one contiguous run; i.e. the L and B dimensions are outermost.
is_block_contiguous property ¶
True when [H, N, C] is contiguous within a block.
is_block_outermost property ¶
True when B is the outermost physical dimension.
is_layer_compact property ¶
True when the layer is compact; i.e. the L dimension is outermost.
layer_view_order property ¶
Physical axis order of a logical 4D per-layer cache view.