vllm.v1.worker.gpu.attn_utils ¶
Classes:
Functions:
-
compute_mm_prefix_ranges–Compute PrefixLM bidirectional ranges for multimodal tokens.
-
get_query_lens_mismatch_unsupported_backend–Name the first backend needing the CPU query lengths to be exact, if any.
AttentionCGSupportInfo dataclass ¶
Methods:
-
narrow–Return an info tightened by
supportif it is more restrictive.
Source code in vllm/v1/worker/gpu/attn_utils.py
narrow(support, backend) ¶
Return an info tightened by support if it is more restrictive.
Lets attention groups built outside init_attn_backend (e.g. encoder-only layers) contribute to the runner's cudagraph decision.
Source code in vllm/v1/worker/gpu/attn_utils.py
compute_mm_prefix_ranges(req_ids, mm_features, sliding_window=None) ¶
Compute PrefixLM bidirectional ranges for multimodal tokens.
Ranges exceeding sliding_window are skipped to prevent early tokens from attending across the entire image span.
Source code in vllm/v1/worker/gpu/attn_utils.py
get_query_lens_mismatch_unsupported_backend(attn_groups) ¶
Name the first backend needing the CPU query lengths to be exact, if any.
The attention selector already excludes these when adaptive verification is enabled, but models that hard-wire their backend never consult it. See AttentionBackend.supports_device_cpu_query_lens_mismatch().