File tree Expand file tree Collapse file tree
vllm/v1/attention/backends Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1139,9 +1139,7 @@ def build(
11391139 "attention is available."
11401140 )
11411141 prefill_use_trtllm = True
1142- decode_with_flashinfer_trtllm_api = (
1143- causal and self .use_trtllm_decode_attention
1144- )
1142+ decode_with_flashinfer_trtllm_api = causal and self .use_trtllm_decode_attention
11451143
11461144 if not causal and self .use_dcp :
11471145 raise NotImplementedError (
@@ -1242,10 +1240,7 @@ def build(
12421240 # Compute paged_kv_indices if necessary
12431241 # paged_kv_indices is only needed for FlashInfer native paths;
12441242 # XQA/trtllm-gen paths use block_tables directly on GPU.
1245- needs_native_paged_prefill = (
1246- num_prefills > 0
1247- and not prefill_use_trtllm
1248- )
1243+ needs_native_paged_prefill = num_prefills > 0 and not prefill_use_trtllm
12491244 needs_native_paged_decode = (
12501245 num_decodes > 0 and not decode_with_flashinfer_trtllm_api
12511246 )
Original file line number Diff line number Diff line change 11# SPDX-License-Identifier: Apache-2.0
22# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
33
4- from typing import TYPE_CHECKING , ClassVar
4+ from typing import ClassVar
55
66import torch
77from flashinfer .decode import trtllm_batch_decode_with_kv_cache_mla
2525)
2626from vllm .v1 .attention .backends .utils import KVCacheLayoutType
2727
28- if TYPE_CHECKING :
29- from vllm .config import VllmConfig
30- from vllm .v1 .kv_cache_interface import AttentionSpec
31-
3228logger = init_logger (__name__ )
3329
3430FLASHINFER_MLA_WORKSPACE_BUFFER_SIZE = 128 * 1024 * 1024
@@ -56,22 +52,6 @@ class FlashInferMLAMetadataBuilder(MLACommonMetadataBuilder[MLACommonMetadata]):
5652 _cudagraph_support : ClassVar [AttentionCGSupport ] = AttentionCGSupport .UNIFORM_BATCH
5753 query_len_support : ClassVar [QueryLenSupport ] = QueryLenSupport .UNIFORM
5854
59- def __init__ (
60- self ,
61- kv_cache_spec : "AttentionSpec" ,
62- layer_names : list [str ],
63- vllm_config : "VllmConfig" ,
64- device : torch .device ,
65- ) -> None :
66- super ().__init__ (
67- kv_cache_spec ,
68- layer_names ,
69- vllm_config ,
70- device ,
71- MLACommonMetadata ,
72- supports_dcp_with_varlen = True ,
73- )
74-
7555
7656class FlashInferMLABackend (MLACommonBackend ):
7757 supported_dtypes : ClassVar [list [torch .dtype ]] = [torch .float16 , torch .bfloat16 ]
You can’t perform that action at this time.
0 commit comments