@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 37c9859fab
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 9, 17:06 UTC

[Refactor] Clean up unused variables & func (#32692)

Signed-off-by: yewentao256 <zhyanwentao@126.com>

Wentao Ye committed Jan 23, 2026 at 17:04 UTC 37c9859fab60bbc346be20a662387479eb0760de
5 files changed -30
vllm/entrypoints/openai/engine/protocol.py
-3
@@ -7,7 +7,6 @@ import time
7 from typing import Any, ClassVar, Literal, TypeAlias
8
9 import regex as re
10 -import torch
10 from pydantic import (
11 BaseModel,
12 ConfigDict,
@@ -25,8 +24,6 @@ from vllm.utils.import_utils import resolve_obj_by_qualname
24
25 logger = init_logger(__name__)
26
28 -_LONG_INFO = torch.iinfo(torch.long)
29 -
27
28 class OpenAIBaseModel(BaseModel):
29 # OpenAI API does allow extra fields
vllm/model_executor/layers/quantization/utils/petit_utils.py
-4
@@ -38,10 +38,6 @@ def _import_petit_kernel() -> "ModuleType":
38 raise ImportError(_PETIT_INSTALL_MSG) from None
39
40
41 -# The _require_petit function can now be a simple alias for consistency.
42 -_require_petit = _import_petit_kernel
43 -
44 -
41 def _check_petit_nvfp4_supported(
42 quant_method: str, group_size: int | None
43 ) -> tuple[bool, str | None]:
vllm/model_executor/models/glmasr_utils.py
-20
@@ -166,23 +166,3 @@ def _extract_mask_for_item(
166 return feature_attention_mask[start_idx:end_idx]
167 mask_slice = feature_attention_mask[start_idx:end_idx]
168 return _normalize_to_tensor(mask_slice)
169 -
170 -
171 -def _get_num_features_for_item(
172 - feature_attention_mask: torch.Tensor | None,
173 - chunk_counts: torch.Tensor | list[int] | None,
174 - item_idx: int,
175 - audio_embeds: list[torch.Tensor] | None,
176 - merge_factor: int,
177 - conv_params: list[tuple[int, int, int]],
178 -) -> int:
179 - """Get number of features for a specific audio item."""
180 - if feature_attention_mask is not None:
181 - mask = _extract_mask_for_item(feature_attention_mask, chunk_counts, item_idx)
182 - audio_output_lengths = _get_audio_output_lengths_from_mask(
183 - mask, merge_factor, conv_params
184 - )
185 - return audio_output_lengths.sum().item()
186 - if audio_embeds is not None:
187 - return audio_embeds[item_idx].shape[0]
188 - raise ValueError("Either feature_attention_mask or audio_embeds must be provided")
vllm/model_executor/models/phi4mm_audio.py
-2
@@ -33,8 +33,6 @@ from vllm.model_executor.models.phi4mm_utils import (
33 unfold_tensor,
34 )
35
36 -_AUDIO_PLACEHOLDER_TOKEN_ID = 200011 # <|endoftext11|>
37 -
36
37 class ConformerEncoderLayer(nn.Module):
38 """ConformerEncoder Layer module.
vllm/platforms/rocm.py
-1
@@ -48,7 +48,6 @@ _ROCM_UNSUPPORTED_MODELS: list[str] = []
48
49 # Models partially supported by ROCm.
50 # Architecture -> Reason.
51 -_ROCM_SWA_REASON = ()
51 _ROCM_PARTIALLY_SUPPORTED_MODELS: dict[str, str] = {}
52 _ROCM_DEVICE_ID_NAME_MAP: dict[str, str] = {
53 "0x74a0": "AMD_Instinct_MI300A",