vllm.v1.attention.backends.mla.flashinfer_mla_sparse ¶
FlashInfer MLA Sparse Attention Backend.
This backend uses the FlashInfer TRT-LLM MLA kernel with sparse_mla_top_k for models like DeepSeek-V3.2 that use index-based sparse attention.
For sparse MLA: - block_tables shape changes from [batch_size, max_num_blocks] (dense) to [batch_size, q_len_per_request, sparse_mla_top_k] (sparse) - The sparse indices represent physical cache slot positions to attend to - sparse_mla_top_k parameter must be set to the topk value
FlashInferMLASparseBackend ¶
Bases: AttentionBackend
FlashInfer MLA backend with sparse attention support.
This backend uses the FlashInfer TRT-LLM MLA kernel with sparse_mla_top_k for models like DeepSeek-V3.2 that use index-based sparse attention.
Source code in vllm/v1/attention/backends/mla/flashinfer_mla_sparse.py
FlashInferMLASparseImpl ¶
Bases: SparseMLAAttentionImpl[FlashInferMLASparseMetadata]
FlashInfer MLA Sparse implementation.
Uses the TRT-LLM MLA kernel with sparse_mla_top_k parameter for sparse attention computation.
Source code in vllm/v1/attention/backends/mla/flashinfer_mla_sparse.py
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 | |
FlashInferMLASparseMetadata dataclass ¶
Bases: AttentionMetadata
Attention metadata for FlashInfer MLA Sparse backend.
Source code in vllm/v1/attention/backends/mla/flashinfer_mla_sparse.py
FlashInferMLASparseMetadataBuilder ¶
Bases: AttentionMetadataBuilder[FlashInferMLASparseMetadata]
Builder for FlashInfer MLA Sparse attention metadata.