Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions backends/cadence/aot/quantizer/fusion_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
Expand Down
Loading