@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 325aa3dee9
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 14, 05:30 UTC

[Misc] local import code clean (#23420)

Signed-off-by: Andy Xie <andy.xning@gmail.com>

Ning Xie committed Aug 22, 2025 at 22:01 UTC 325aa3dee922b344a26b9e74d9ae3c769828e70e
2 files changed +1 -3
vllm/v1/worker/gpu_worker.py
-1
@@ -292,7 +292,6 @@ class Worker(WorkerBase):
292 allocator = CuMemAllocator.get_instance()
293 context = allocator.use_memory_pool(tag="kv_cache")
294 else:
295 - from contextlib import nullcontext
295 context = nullcontext()
296 with context:
297 self.model_runner.initialize_kv_cache(kv_cache_config)
vllm/worker/worker.py
+1 -2
@@ -3,6 +3,7 @@
3 """A GPU worker class."""
4 import gc
5 import os
6 +from contextlib import nullcontext
7 from typing import Dict, List, Optional, Set, Tuple, Type, Union
8
9 import torch
@@ -206,7 +207,6 @@ class Worker(LocalOrDistributedWorkerBase):
207 "used for one instance per process.")
208 context = allocator.use_memory_pool(tag="weights")
209 else:
209 - from contextlib import nullcontext
210 context = nullcontext()
211 with context:
212 self.model_runner.load_model()
@@ -330,7 +330,6 @@ class Worker(LocalOrDistributedWorkerBase):
330 allocator = CuMemAllocator.get_instance()
331 context = allocator.use_memory_pool(tag="kv_cache")
332 else:
333 - from contextlib import nullcontext
333 context = nullcontext()
334 with context:
335 self._init_cache_engine()