From d4f895042d3601fd053956c917dbff176c84694d Mon Sep 17 00:00:00 2001 From: Rattus Date: Tue, 20 Jan 2026 21:57:28 +1000 Subject: [PATCH] execution: remove per node gc.collect() This isn't worth it and the likelyhood of inference leaving a complex data-structure with cyclic reference behind is now. Remove it. We would replace it with a condition on nodes that actually touch the GPU which might be win. --- execution.py | 1 - 1 file changed, 1 deletion(-) diff --git a/execution.py b/execution.py index 197e13f38..4148baaf5 100644 --- a/execution.py +++ b/execution.py @@ -530,7 +530,6 @@ async def execute(server, dynprompt, caches, current_item, extra_data, executed, #FIXME: this is probably a little zealous # Torch code comments says some stuff about not actually freeing tensors on mempool #context release. Explicitly garbage collect now. - gc.collect() torch.cuda.empty_cache() if has_pending_tasks: