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 4, 11:15 UTC
[Bugfix][Compile] Fix gc.collect/empty_cache patch arity in CUDAGraphWrapper (#41235)
Signed-off-by: Roi Koren <roik@nvidia.com>
roikoren755 committed
Apr 30, 2026 at 00:59 UTC
c2fb013312e107c6809b1bf5cc4f22e499e1b81d
1 file changed
+7
-2
vllm/compilation/cuda_graph.py
+7
-2
@@ -290,9 +290,14 @@ class CUDAGraphWrapper:
290
# across layers will make the cudagraph capture very slow.
291
# therefore, we only run gc for the first graph,
292
# and disable gc for the rest of the graphs.
293
- stack.enter_context(patch("gc.collect", lambda: None))
293
stack.enter_context(
295
- patch("torch.accelerator.empty_cache", lambda: None)
294
+ patch("gc.collect", lambda *args, **kwargs: None)
295
+ )
296
+ stack.enter_context(
297
+ patch(
298
+ "torch.accelerator.empty_cache",
299
+ lambda *args, **kwargs: None,
300
+ )
301
)
302
303
if self.graph_pool is not None: