diff --git a/backends/cadence/aot/quantizer/fusion_pass.py b/backends/cadence/aot/quantizer/fusion_pass.py index 5375367b929..36ba258ad20 100644 --- a/backends/cadence/aot/quantizer/fusion_pass.py +++ b/backends/cadence/aot/quantizer/fusion_pass.py @@ -620,6 +620,8 @@ def call(self, graph_module: fx.GraphModule) -> PassResult: # noqa: C901 ) kwargs = {} if isinstance(pattern, AddReluPatterns): + if len(dequants_inputs) != 2: + continue # For AddReLU, we are fusing Add+ReLU. # The quantized_add op performs requantization, # so the relu is implicit in the output quant params. @@ -633,6 +635,8 @@ def call(self, graph_module: fx.GraphModule) -> PassResult: # noqa: C901 quant_node, ) elif isinstance(pattern, AddPattern): + if len(dequants_inputs) != 2: + continue args, kwargs = get_args_and_kwargs_add( graph_module, inputs_inputs,