Skip to content

vllm.v1.worker.cpu.attn_utils

Classes:

Functions:

FastPrefillBatchMetadata dataclass

Per-step inputs for the KV-sharing fast prefill path.

FastPrefillHelper

Decides per step whether to arm the KV-sharing fast prefill path.

get_kv_sharing_fast_prefill_eligible_layers(vllm_config)

Trailing run of KV-sharing layers, eligible for fast prefill.

In You Only Cache Once (https://arxiv.org/abs/2405.05254) or other similar KV sharing setups, only the layers that generate KV caches are involved in the prefill phase, enabling prefill to early exit. Layers are registered in execution order, so the eligible layers are the contiguous suffix of KV-sharing layers.