@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 5e1e0a0fbd
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 8, 22:45 UTC

[Refactor] Remove unused dead code (#33718)

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

Wentao Ye committed Feb 4, 2026 at 00:25 UTC 5e1e0a0fbdf52dd21bfa6bc4dd6e88487a917d23
3 files changed -77
vllm/collect_env.py
-8
@@ -146,14 +146,6 @@ def run_and_parse_first_match(run_lambda, command, regex):
146 return match.group(1)
147
148
149 -def run_and_return_first_line(run_lambda, command):
150 - """Run command using run_lambda and returns first line if output is not empty."""
151 - rc, out, _ = run_lambda(command)
152 - if rc != 0:
153 - return None
154 - return out.split("\n")[0]
155 -
156 -
149 def get_conda_packages(run_lambda, patterns=None):
150 if patterns is None:
151 patterns = DEFAULT_CONDA_PATTERNS
vllm/compilation/fx_utils.py
-15
@@ -18,21 +18,6 @@ def is_auto_func(node: fx.Node, op: OpOverload) -> bool:
18 return is_func(node, auto_functionalized) and node.args[0] == op
19
20
21 -# Returns the first specified node with the given op (if it exists)
22 -def find_specified_fn_maybe(nodes: Iterable[fx.Node], op: OpOverload) -> fx.Node | None:
23 - for node in nodes:
24 - if node.target == op:
25 - return node
26 - return None
27 -
28 -
29 -# Returns the first specified node with the given op
30 -def find_specified_fn(nodes: Iterable[fx.Node], op: OpOverload) -> fx.Node:
31 - node = find_specified_fn_maybe(nodes, op)
32 - assert node is not None, f"Could not find {op} in nodes {nodes}"
33 - return node
34 -
35 -
21 # Returns the first auto_functionalized node with the given op (if it exists)
22 def find_auto_fn_maybe(nodes: Iterable[fx.Node], op: OpOverload) -> fx.Node | None:
23 for node in nodes:
vllm/config/utils.py
-54
@@ -14,7 +14,6 @@ from dataclasses import MISSING, Field, field, fields, is_dataclass
14 from itertools import pairwise
15 from typing import TYPE_CHECKING, Any, Protocol, TypeVar, cast
16
17 -import regex as re
17 import torch
18 from pydantic import ConfigDict
19 from pydantic.dataclasses import dataclass
@@ -144,34 +143,6 @@ def getattr_iter(
143 return default_factory() if default_factory is not None else default
144
145
147 -def contains_object_print(text: str) -> bool:
148 - """
149 - Check if the text looks like a printed Python object, e.g.
150 - contains any substring matching the pattern: "at 0xFFFFFFF>"
151 - We match against 0x followed by 2-16 hex chars (there's
152 - a max of 16 on a 64-bit system).
153 -
154 - Args:
155 - text (str): The text to check
156 -
157 - Returns:
158 - result (bool): `True` if a match is found, `False` otherwise.
159 - """
160 - pattern = r"at 0x[a-fA-F0-9]{2,16}>"
161 - match = re.search(pattern, text)
162 - return match is not None
163 -
164 -
165 -def assert_hashable(text: str) -> bool:
166 - if not contains_object_print(text):
167 - return True
168 - raise AssertionError(
169 - f"vLLM tried to hash some configs that may have Python objects ids "
170 - f"in them. This is a bug, please file an issue. "
171 - f"Text being hashed: {text}"
172 - )
173 -
174 -
146 def get_attr_docs(cls: type[Any]) -> dict[str, str]:
147 """
148 Get any docstrings placed after attribute assignments in a class body.
@@ -354,31 +325,6 @@ def hash_factors(items: dict[str, object]) -> str:
325 return hashlib.sha256(json.dumps(items, sort_keys=True).encode()).hexdigest()
326
327
357 -def handle_deprecated(
358 - config: ConfigT,
359 - old_name: str,
360 - new_name_or_names: str | list[str],
361 - removal_version: str,
362 -) -> None:
363 - old_val = getattr(config, old_name)
364 - if old_val is None:
365 - return
366 -
367 - if isinstance(new_name_or_names, str):
368 - new_names = [new_name_or_names]
369 - else:
370 - new_names = new_name_or_names
371 -
372 - msg = (
373 - f"{old_name} is deprecated and will be removed in {removal_version}. "
374 - f"Use {', '.join(new_names)} instead."
375 - )
376 - logger.warning(msg)
377 -
378 - for new_name in new_names:
379 - setattr(config, new_name, old_val)
380 -
381 -
328 @dataclass
329 class Range:
330 """