@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 6a585a23d2
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 16, 08:15 UTC

[Hotfix] Fix ruff errors (#10073)

Signed-off-by: Woosuk Kwon <woosuk.kwon@berkeley.edu>

Woosuk Kwon committed Nov 6, 2024 at 01:24 UTC 6a585a23d2e7960164c7bd9d767858d50ac54c47
3 files changed +5 -7
setup.py
+1 -2
@@ -382,8 +382,7 @@ def get_gaudi_sw_version():
382 output = subprocess.run("hl-smi",
383 shell=True,
384 text=True,
385 - stdout=subprocess.PIPE,
386 - stderr=subprocess.PIPE,
385 + capture_output=True,
386 env={"ENABLE_CONSOLE": "true"})
387 if output.returncode == 0 and output.stdout:
388 return output.stdout.split("\n")[2].replace(
vllm/executor/ray_hpu_executor.py
+1 -1
@@ -34,7 +34,7 @@ class RayHPUExecutor(DistributedGPUExecutor):
34 uses_ray: bool = True
35
36 def _init_executor(self) -> None:
37 - self.forward_dag: Optional["ray.dag.CompiledDAG"] = None
37 + self.forward_dag: Optional[ray.dag.CompiledDAG] = None
38 # If the env var is set, it uses the Ray's compiled DAG API
39 # which optimizes the control plane overhead.
40 # Run vLLM with VLLM_USE_RAY_COMPILED_DAG=1 to enable it.
vllm/worker/hpu_model_runner.py
+3 -4
@@ -67,8 +67,7 @@ class Singleton(type):
67
68 def __call__(cls, *args, **kwargs):
69 if cls not in cls._instances:
70 - cls._instances[cls] = super(Singleton,
71 - cls).__call__(*args, **kwargs)
70 + cls._instances[cls] = super().__call__(*args, **kwargs)
71 return cls._instances[cls]
72
73
@@ -273,7 +272,7 @@ def precompute_indices_and_offsets(block_size, slot_mapping, is_prompt):
272 return indices, offsets
273
274
276 -class HpuModelAdapter():
275 +class HpuModelAdapter:
276
277 def __init__(self, model, block_size, dtype, enforce_eager):
278 self.model = model
@@ -1643,7 +1642,7 @@ def _maybe_wrap_in_hpu_graph(*args, **kwargs):
1642 ) if htorch.utils.internal.is_lazy() else HpuModelAdapter(*args, **kwargs)
1643
1644
1646 -class HabanaProfilerCounterHelper():
1645 +class HabanaProfilerCounterHelper:
1646
1647 def __init__(self):
1648 self.niter = 0