[Bugfix][Compile] Fix gc.collect/empty_cache patch arity in CUDAGraphWrapper (#41235)
Signed-off-by: Roi Koren <roik@nvidia.com>
This commit is contained in:
@@ -290,9 +290,14 @@ class CUDAGraphWrapper:
|
|||||||
# across layers will make the cudagraph capture very slow.
|
# across layers will make the cudagraph capture very slow.
|
||||||
# therefore, we only run gc for the first graph,
|
# therefore, we only run gc for the first graph,
|
||||||
# and disable gc for the rest of the graphs.
|
# and disable gc for the rest of the graphs.
|
||||||
stack.enter_context(patch("gc.collect", lambda: None))
|
|
||||||
stack.enter_context(
|
stack.enter_context(
|
||||||
patch("torch.accelerator.empty_cache", lambda: None)
|
patch("gc.collect", lambda *args, **kwargs: None)
|
||||||
|
)
|
||||||
|
stack.enter_context(
|
||||||
|
patch(
|
||||||
|
"torch.accelerator.empty_cache",
|
||||||
|
lambda *args, **kwargs: None,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.graph_pool is not None:
|
if self.graph_pool is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user