[Attention]: Use KVCacheSpec for AttentionMetadataBuilder type hints (#50148)

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
This commit is contained in:
Martin Hickey
2026-07-31 11:20:18 +00:00
committed by GitHub
parent 92643d68f5
commit b2fb83e7ff
14 changed files with 34 additions and 33 deletions
@@ -20,7 +20,6 @@ from vllm.v1.attention.backends.utils import (
)
from vllm.v1.attention.selector import get_attn_backend
from vllm.v1.kv_cache_interface import (
AttentionSpec,
ChunkedLocalAttentionSpec,
KVCacheSpec,
get_kv_quant_mode,
@@ -42,7 +41,7 @@ def create_chunked_local_attention_backend(
def get_cudagraph_support(
cls: type["AttentionMetadataBuilder"],
vllm_config: VllmConfig,
kv_cache_spec: AttentionSpec,
kv_cache_spec: KVCacheSpec,
) -> AttentionCGSupport:
# Explicit override in case the underlying builder specialized this getter.
# @override omitted only because of mypy limitation due to type variable.
@@ -1722,6 +1722,8 @@ class MLACommonMetadataBuilder(AttentionMetadataBuilder[M]):
understand this class
"""
kv_cache_spec: AttentionSpec
# Defines the level of query length support for this backend.
# - SINGLE_ONLY: Only single-token queries (no spec decode support)
# - UNIFORM: Supports uniform multi-token queries (spec decode with uniform lengths)