Skip to content

Commit 0f01347

Browse files
committed
update
Signed-off-by: shen-shanshan <467638484@qq.com>
1 parent 34dcbdb commit 0f01347

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

vllm/v1/engine/core.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,10 @@ def step_with_batch_queue(self) -> Optional[EngineCoreOutputs]:
249249
return engine_core_outputs
250250

251251
def shutdown(self):
252+
self.structured_output_manager.clear_backend()
252253
if self.model_executor:
253254
self.model_executor.shutdown()
254255

255-
so_backend = self.structured_output_manager.backend
256-
if so_backend is not None:
257-
so_backend.destroy()
258-
259256
def profile(self, is_start: bool = True):
260257
self.model_executor.profile(is_start)
261258

vllm/v1/structured_output/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,7 @@ def grammar_bitmask(
107107
# np.ndarray, because that is much more efficient for serialization
108108
# and deserialization when sending this to the GPU workers.
109109
return bitmask_tensor.numpy()
110+
111+
def clear_backend(self) -> None:
112+
if self.backend is not None:
113+
self.backend.destroy()

vllm/v1/structured_output/backend_types.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,5 @@ def allocate_token_bitmask(self, max_num_seqs: int):
9191
@abstractmethod
9292
def destroy(self):
9393
"""
94-
Clear objects in the backend to avoid nanobind leaked.
94+
Backend-specific cleanup.
9595
"""

0 commit comments

Comments
 (0)