Skip to content

Commit 6faf4b4

Browse files
andyxningepwalsh
authored andcommitted
[Misc] local import code clean (vllm-project#23420)
Signed-off-by: Andy Xie <[email protected]>
1 parent 65c6409 commit 6faf4b4

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

vllm/v1/worker/gpu_worker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ def initialize_from_config(self, kv_cache_config: KVCacheConfig) -> None:
292292
allocator = CuMemAllocator.get_instance()
293293
context = allocator.use_memory_pool(tag="kv_cache")
294294
else:
295-
from contextlib import nullcontext
296295
context = nullcontext()
297296
with context:
298297
self.model_runner.initialize_kv_cache(kv_cache_config)

vllm/worker/worker.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""A GPU worker class."""
44
import gc
55
import os
6+
from contextlib import nullcontext
67
from typing import Dict, List, Optional, Set, Tuple, Type, Union
78

89
import torch
@@ -206,7 +207,6 @@ def load_model(self):
206207
"used for one instance per process.")
207208
context = allocator.use_memory_pool(tag="weights")
208209
else:
209-
from contextlib import nullcontext
210210
context = nullcontext()
211211
with context:
212212
self.model_runner.load_model()
@@ -330,7 +330,6 @@ def initialize_cache(self, num_gpu_blocks: int,
330330
allocator = CuMemAllocator.get_instance()
331331
context = allocator.use_memory_pool(tag="kv_cache")
332332
else:
333-
from contextlib import nullcontext
334333
context = nullcontext()
335334
with context:
336335
self._init_cache_engine()

0 commit comments

Comments
 (0)