A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 9, 18:15 UTC
[Misc] Add `get_name` to missing AttentionBackends (#32698)
Signed-off-by: NickLucche <nlucches@redhat.com>
Nicolò Lucchesi committed
Jan 23, 2026 at 11:35 UTC
160c6fa3872aaed5e9d425deb9ad8573da359f2b
6 files changed
+28
-1
vllm/v1/attention/backends/gdn_attn.py
+4
@@ -22,6 +22,10 @@ from vllm.v1.kv_cache_interface import AttentionSpec, MambaSpec
22
23
24
class GDNAttentionBackend(AttentionBackend):
25
+ @staticmethod
26
+ def get_name() -> str:
27
+ return "GDN_ATTN"
28
+
29
@staticmethod
30
def get_builder_cls() -> type["GDNAttentionMetadataBuilder"]:
31
return GDNAttentionMetadataBuilder
vllm/v1/attention/backends/linear_attn.py
+4
@@ -16,6 +16,10 @@ from vllm.v1.kv_cache_interface import AttentionSpec, MambaSpec
16
17
18
class LinearAttentionBackend(AttentionBackend):
19
+ @staticmethod
20
+ def get_name() -> str:
21
+ return "LINEAR_ATTN"
22
+
23
@staticmethod
24
def get_builder_cls() -> type["LinearAttentionMetadataBuilder"]:
25
return LinearAttentionMetadataBuilder
vllm/v1/attention/backends/mamba1_attn.py
+4
@@ -11,6 +11,10 @@ from vllm.v1.attention.backends.mamba_attn import (
11
12
13
class Mamba1AttentionBackend(AttentionBackend):
14
+ @staticmethod
15
+ def get_name() -> str:
16
+ return "MAMBA1_ATTN"
17
+
18
@staticmethod
19
def get_builder_cls() -> type["Mamba1AttentionMetadataBuilder"]:
20
return Mamba1AttentionMetadataBuilder
vllm/v1/attention/backends/mamba2_attn.py
+8
-1
@@ -7,7 +7,10 @@ import torch
7
8
from vllm.config import VllmConfig
9
from vllm.utils.math_utils import cdiv
10
-from vllm.v1.attention.backend import AttentionBackend, CommonAttentionMetadata
10
+from vllm.v1.attention.backend import (
11
+ AttentionBackend,
12
+ CommonAttentionMetadata,
13
+)
14
from vllm.v1.attention.backends.mamba_attn import (
15
BaseMambaAttentionMetadata,
16
BaseMambaAttentionMetadataBuilder,
@@ -85,6 +88,10 @@ def compute_varlen_chunk_metadata(
88
89
90
class Mamba2AttentionBackend(AttentionBackend):
91
+ @staticmethod
92
+ def get_name() -> str:
93
+ return "MAMBA2_ATTN"
94
+
95
@staticmethod
96
def get_builder_cls() -> type["Mamba2AttentionMetadataBuilder"]:
97
return Mamba2AttentionMetadataBuilder
vllm/v1/attention/backends/mla/indexer.py
+4
@@ -25,6 +25,10 @@ logger = init_logger(__name__)
25
26
27
class DeepseekV32IndexerBackend(AttentionBackend):
28
+ @staticmethod
29
+ def get_name() -> str:
30
+ return "DEEPSEEK_V32_INDEXER"
31
+
32
@staticmethod
33
def get_supported_kernel_block_sizes() -> list[int | MultipleOf]:
34
return [1 if current_platform.is_rocm() else 64]
vllm/v1/attention/backends/short_conv_attn.py
+4
@@ -10,6 +10,10 @@ from vllm.v1.attention.backends.mamba_attn import (
10
11
12
class ShortConvAttentionBackend(AttentionBackend):
13
+ @staticmethod
14
+ def get_name() -> str:
15
+ return "SHORT_CONV_ATTN"
16
+
17
@staticmethod
18
def get_builder_cls() -> type["ShortConvAttentionMetadataBuilder"]:
19
return ShortConvAttentionMetadataBuilder