From ec109fc86cced365faf7356fbe3348f4a8e00ccf Mon Sep 17 00:00:00 2001 From: ssjia Date: Thu, 12 Feb 2026 13:36:29 -0800 Subject: [PATCH] [ET-VK] Fix FuseClampPass incorrectly fusing conv+activation when conv has multiple users The FuseClampPass fuses patterns like conv -> relu into a single conv_with_clamp op. However, it did not check whether the convolution node's output has multiple consumers before fusing. When a conv output feeds both a relu and another op (e.g. a skip connection), fusing the relu into the conv incorrectly applies the activation to all consumers, corrupting the skip connection values. This was causing incorrect output in the MetaNet GreenScreen model, where decoder projection convolutions feed both into ResidualConvUnit (through relu) and into skip connections (without relu). The fix adds a check that the preceding conv has exactly one user before allowing fusion. Differential Revision: [D93145845](https://our.internmc.facebook.com/intern/diff/D93145845/) [ghstack-poisoned] --- backends/transforms/fuse_conv_with_clamp.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backends/transforms/fuse_conv_with_clamp.py b/backends/transforms/fuse_conv_with_clamp.py index 3f45296b26c..ae7c505d139 100644 --- a/backends/transforms/fuse_conv_with_clamp.py +++ b/backends/transforms/fuse_conv_with_clamp.py @@ -48,6 +48,7 @@ def call(self, graph_module: torch.fx.GraphModule): if ( preceding_op.op == "call_function" and preceding_op.target in self.FUSEABLE_OPS + and len(preceding_op.users) == 1 ): # Delete activation output_min_max = self.get_output_min_max_from_activation(