Skip to content

Commit 5197225

Browse files
wangxiyuanwendyliu235
authored andcommitted
[Misc] Cleanup useless current_platform import (vllm-project#35715)
Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
1 parent 625dc17 commit 5197225

5 files changed

Lines changed: 0 additions & 17 deletions

File tree

vllm/compilation/passes/fusion/sequence_parallelism.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from vllm.model_executor.layers.quantization.utils.quant_utils import (
1919
kFp8StaticTensorSym,
2020
)
21-
from vllm.platforms import current_platform
2221

2322
from ..inductor_pass import enable_fake_mode
2423
from ..utility.noop_elimination import NoOpEliminationPass
@@ -215,9 +214,6 @@ def replacement(
215214
)
216215

217216

218-
FP8_DTYPE = current_platform.fp8_dtype()
219-
220-
221217
class FirstAllReduceRMSNormStaticFP8Pattern(_SequenceParallelPatternHelper):
222218
def __init__(
223219
self,

vllm/config/model.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,6 @@ def __post_init__(
461461

462462
self.maybe_pull_model_tokenizer_for_runai(self.model, self.tokenizer)
463463

464-
from vllm.platforms import current_platform
465-
466464
if self.override_attention_dtype is not None and not current_platform.is_rocm():
467465
warnings.warn(
468466
"override-attention-dtype is set but not using ROCm platform",
@@ -940,8 +938,6 @@ def _verify_quantization(self) -> None:
940938
f"Unknown quantization method: {self.quantization}. Must "
941939
f"be one of {supported_quantization}."
942940
)
943-
from vllm.platforms import current_platform
944-
945941
current_platform.verify_quantization(self.quantization)
946942

947943
if self.quantization in me_quant.DEPRECATED_QUANTIZATION_METHODS:
@@ -1811,8 +1807,6 @@ def _resolve_auto_dtype(
18111807
*,
18121808
is_pooling_model: bool,
18131809
):
1814-
from vllm.platforms import current_platform
1815-
18161810
supported_dtypes = [
18171811
dtype
18181812
for dtype in current_platform.supported_dtypes

vllm/distributed/parallel_state.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,6 @@ def __init__(
385385
self.cpu_group, 1 << 22, 6
386386
)
387387

388-
from vllm.platforms import current_platform
389-
390388
self.use_custom_op_call = (
391389
current_platform.is_cuda_alike() or current_platform.is_tpu()
392390
)

vllm/v1/attention/backends/fa_utils.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ def get_scheduler_metadata(*args: Any, **kwargs: Any) -> None: # type: ignore[m
5555
def get_flash_attn_version(
5656
requires_alibi: bool = False, head_size: int | None = None
5757
) -> int | None:
58-
# import here to avoid circular dependencies
59-
from vllm.platforms import current_platform
60-
6158
if current_platform.is_xpu():
6259
return 2
6360
if current_platform.is_rocm():

vllm/v1/attention/backends/flashinfer.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,6 @@ def supports_sink(cls) -> bool:
374374

375375
@classmethod
376376
def get_required_kv_cache_layout(cls) -> KVCacheLayoutType | None:
377-
from vllm.platforms import current_platform
378-
379377
capability = current_platform.get_device_capability()
380378
if capability is not None and capability.major == 10:
381379
return "HND"

0 commit comments

Comments
 (0)