@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 510bc9e1df
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 7, 11:30 UTC

[Misc] Cleanup useless `current_platform` import (#35715)

Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>

wangxiyuan committed Mar 2, 2026 at 17:36 UTC 510bc9e1df082fc58fef1867399cd02baa9ebb47
5 files changed -17
vllm/compilation/passes/fusion/sequence_parallelism.py
-4
@@ -18,7 +18,6 @@ from vllm.logger import init_logger
18 from vllm.model_executor.layers.quantization.utils.quant_utils import (
19 kFp8StaticTensorSym,
20 )
21 -from vllm.platforms import current_platform
21
22 from ..inductor_pass import enable_fake_mode
23 from ..utility.noop_elimination import NoOpEliminationPass
@@ -215,9 +214,6 @@ class MiddleAllReduceRMSNormPattern(_SequenceParallelPatternHelper):
214 )
215
216
218 -FP8_DTYPE = current_platform.fp8_dtype()
219 -
220 -
217 class FirstAllReduceRMSNormStaticFP8Pattern(_SequenceParallelPatternHelper):
218 def __init__(
219 self,
vllm/config/model.py
-6
@@ -461,8 +461,6 @@ class ModelConfig:
461
462 self.maybe_pull_model_tokenizer_for_runai(self.model, self.tokenizer)
463
464 - from vllm.platforms import current_platform
465 -
464 if self.override_attention_dtype is not None and not current_platform.is_rocm():
465 warnings.warn(
466 "override-attention-dtype is set but not using ROCm platform",
@@ -940,8 +938,6 @@ class ModelConfig:
938 f"Unknown quantization method: {self.quantization}. Must "
939 f"be one of {supported_quantization}."
940 )
943 - from vllm.platforms import current_platform
944 -
941 current_platform.verify_quantization(self.quantization)
942
943 if self.quantization in me_quant.DEPRECATED_QUANTIZATION_METHODS:
@@ -1811,8 +1807,6 @@ def _resolve_auto_dtype(
1807 *,
1808 is_pooling_model: bool,
1809 ):
1814 - from vllm.platforms import current_platform
1815 -
1810 supported_dtypes = [
1811 dtype
1812 for dtype in current_platform.supported_dtypes
vllm/distributed/parallel_state.py
-2
@@ -385,8 +385,6 @@ class GroupCoordinator:
385 self.cpu_group, 1 << 22, 6
386 )
387
388 - from vllm.platforms import current_platform
389 -
388 self.use_custom_op_call = (
389 current_platform.is_cuda_alike() or current_platform.is_tpu()
390 )
vllm/v1/attention/backends/fa_utils.py
-3
@@ -55,9 +55,6 @@ elif current_platform.is_rocm():
55 def get_flash_attn_version(
56 requires_alibi: bool = False, head_size: int | None = None
57 ) -> int | None:
58 - # import here to avoid circular dependencies
59 - from vllm.platforms import current_platform
60 -
58 if current_platform.is_xpu():
59 return 2
60 if current_platform.is_rocm():
vllm/v1/attention/backends/flashinfer.py
-2
@@ -374,8 +374,6 @@ class FlashInferBackend(AttentionBackend):
374
375 @classmethod
376 def get_required_kv_cache_layout(cls) -> KVCacheLayoutType | None:
377 - from vllm.platforms import current_platform
378 -
377 capability = current_platform.get_device_capability()
378 if capability is not None and capability.major == 10:
379 return "HND"