vllm.v1.attention.backends.mla.flashinfer_mla ¶
FLASHINFER_MLA_WORKSPACE_BUFFER_SIZE module-attribute ¶
g_fi_workspace module-attribute ¶
g_fi_workspace = zeros(
FLASHINFER_MLA_WORKSPACE_BUFFER_SIZE,
dtype=uint8,
device="cuda",
)
FlashInferMLABackend ¶
Bases: MLACommonBackend
Source code in vllm/v1/attention/backends/mla/flashinfer_mla.py
supported_kv_cache_dtypes class-attribute ¶
supported_kv_cache_dtypes: list[CacheDType] = [
"auto",
"bfloat16",
"fp8",
"fp8_e4m3",
]
get_builder_cls staticmethod ¶
get_builder_cls() -> type[FlashInferMLAMetadataBuilder]
get_impl_cls staticmethod ¶
get_impl_cls() -> type[FlashInferMLAImpl]
get_required_kv_cache_layout classmethod ¶
get_required_kv_cache_layout() -> KVCacheLayoutType | None
get_supported_kernel_block_sizes staticmethod ¶
get_supported_kernel_block_sizes() -> list[
int | MultipleOf
]
supports_combination classmethod ¶
supports_combination(
head_size: int,
dtype: dtype,
kv_cache_dtype: CacheDType | None,
block_size: int,
use_mla: bool,
has_sink: bool,
use_sparse: bool,
device_capability: DeviceCapability,
) -> str | None
Source code in vllm/v1/attention/backends/mla/flashinfer_mla.py
supports_compute_capability classmethod ¶
supports_compute_capability(
capability: DeviceCapability,
) -> bool
FlashInferMLAImpl ¶
Bases: MLACommonImpl[MLACommonMetadata]
Source code in vllm/v1/attention/backends/mla/flashinfer_mla.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | |
__init__ ¶
__init__(
num_heads: int,
head_size: int,
scale: float,
num_kv_heads: int,
alibi_slopes: list[float] | None,
sliding_window: int | None,
kv_cache_dtype: str,
logits_soft_cap: float | None,
attn_type: str,
kv_sharing_target_layer_name: str | None,
**mla_args,
) -> None
Source code in vllm/v1/attention/backends/mla/flashinfer_mla.py
_forward_decode ¶
_forward_decode(
q: Tensor | tuple[Tensor, Tensor],
kv_c_and_k_pe_cache: Tensor,
attn_metadata: MLACommonMetadata,
layer: AttentionLayer,
) -> tuple[Tensor, Tensor | None]
Source code in vllm/v1/attention/backends/mla/flashinfer_mla.py
FlashInferMLAMetadataBuilder ¶
Bases: MLACommonMetadataBuilder[MLACommonMetadata]