From 5ba0879204b61cb4b21fae92c193caf7b0a78fe9 Mon Sep 17 00:00:00 2001 From: ddilbaz Date: Thu, 7 Nov 2024 15:52:16 +0000 Subject: [PATCH] Revised intermediary removal --- tt_torch/dynamo/backend.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tt_torch/dynamo/backend.py b/tt_torch/dynamo/backend.py index 05d3f0a8..814c3021 100644 --- a/tt_torch/dynamo/backend.py +++ b/tt_torch/dynamo/backend.py @@ -322,15 +322,17 @@ def run_gm_op_by_op(self, *inputs): del node_to_tensor[arg] out_degree.pop(arg) # Handle any intermediaries left - might be redundant - intermediates = [node for node, users in out_degree.items() if users == 0 and node.op != "output"] + intermediates = [ + node + for node, users in out_degree.items() + if users == 0 and node.op != "output" + ] for node in intermediates: del node_to_tensor[node] self.compiler_config.save_unique_ops() return outputs - - def __call__(self, *inputs): if self.compiler_config.compile_depth == CompileDepth.EXECUTE: assert self.binary is not None, "Binary must be set for EXECUTE mode"