vllm.v1.worker.cpu.attn_utils
¶
Classes:
-
FastPrefillBatchMetadata–Per-step inputs for the KV-sharing fast prefill path.
-
FastPrefillHelper–Decides per step whether to arm the KV-sharing fast prefill path.
Functions:
-
get_kv_sharing_fast_prefill_eligible_layers–Trailing run of KV-sharing layers, eligible for fast prefill.
FastPrefillBatchMetadata
dataclass
¶
Per-step inputs for the KV-sharing fast prefill path.
Source code in vllm/v1/worker/cpu/attn_utils.py
FastPrefillHelper
¶
Decides per step whether to arm the KV-sharing fast prefill path.
Source code in vllm/v1/worker/cpu/attn_utils.py
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.