Skip to content

Commit 2a0a363

Browse files
committed
Fix precommit and undo changes to flashinfer_mla.py
Signed-off-by: Pavani Majety <pmajety@nvidia.com>
1 parent 7d2fac7 commit 2a0a363

2 files changed

Lines changed: 3 additions & 28 deletions

File tree

vllm/v1/attention/backends/flashinfer.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff 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
)

vllm/v1/attention/backends/mla/flashinfer_mla.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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

66
import torch
77
from flashinfer.decode import trtllm_batch_decode_with_kv_cache_mla
@@ -25,10 +25,6 @@
2525
)
2626
from 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-
3228
logger = init_logger(__name__)
3329

3430
FLASHINFER_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

7656
class FlashInferMLABackend(MLACommonBackend):
7757
supported_dtypes: ClassVar[list[torch.dtype]] = [torch.float16, torch.bfloat16]

0 commit comments

Comments
 (0)