[kv_offload] Skip decode-phase blocks in CPU offload (#43797)

Signed-off-by: Itay Etelis <itay.etelis@ibm.com>
Co-authored-by: Itay Etelis <itay.etelis@ibm.com>
This commit is contained in:
Itay Etelis
2026-05-29 06:39:43 +03:00
committed by GitHub
co-authored by Itay Etelis
parent 9636709372
commit d63108fb18
4 changed files with 76 additions and 0 deletions
+8
View File
@@ -380,6 +380,14 @@ class OffloadingSpec(ABC):
assert kv_transfer_config is not None
self.extra_config = kv_transfer_config.kv_connector_extra_config
# When True, only prompt (prefill) blocks are offloaded; decode-phase
# blocks (KV generated after the prompt) are skipped. Useful when prior
# turns' generated tokens are dropped before the next turn (e.g.
# reasoning models that strip thinking).
self.offload_prompt_only: bool = bool(
self.extra_config.get("offload_prompt_only", True)
)
parallel_config = vllm_config.parallel_config
context_parallel_factor = (
parallel_config.decode_context_parallel_size