vllm.v1.worker.cp_utils ¶
Functions:
-
prepare_dcp_dummy_context_metadata–Populate valid fake KV metadata for DCP CUDA graph warmup/capture.
-
should_skip_dcp_context_attention–Whether DCP context attention can be skipped for this batch.
-
split_dcp_context_queries–Split reordered DCP context queries into decode and extend regions.
prepare_dcp_dummy_context_metadata(*, input_batch, kv_cache_config, query_pos, positions, query_start_loc, num_reqs, num_tokens_unpadded, dcp_dummy_context_len) ¶
Populate valid fake KV metadata for DCP CUDA graph warmup/capture.
Source code in vllm/v1/worker/cp_utils.py
should_skip_dcp_context_attention(context_kv_lens_cpu) ¶
Whether DCP context attention can be skipped for this batch.
Must be computed from rank-invariant inputs only (the global context lengths, NOT this rank's local share from get_dcp_local_seq_lens): the non-skip path in _forward_with_dcp issues DCP collectives (query all-gather + LSE combine), so every DCP rank must take the same branch. A rank can hold zero local context tokens while other ranks still hold context for the same batch.
Source code in vllm/v1/worker/cp_utils.py
split_dcp_context_queries(query_start_loc, seq_lens_cpu_upper_bound, max_query_len, num_actual_tokens) ¶
Split reordered DCP context queries into decode and extend regions.