[pt2e][xnnpack_quantizer] quantize "mul" (#110428)

Adding "mul" to list of partitions that are supported by the quantizer. This shows up in EDSR, where we still want to quantize the mul op

Differential Revision: [D49850151](https://our.internmc.facebook.com/intern/diff/D49850151/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/110428
Approved by: https://github.com/jerryzh168
ghstack dependencies: #110427
This commit is contained in:
Max Ren 2023-10-03 15:06:00 -07:00 committed by PyTorch MergeBot
parent 66202ed29c
commit 08c7dcda65
2 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ _EQUIVALENT_TYPES: List[Set] = [
{torch.nn.BatchNorm2d, torch.nn.functional.batch_norm},
{torch.nn.Hardtanh, torch.nn.functional.hardtanh, torch.nn.functional.hardtanh_},
{torch.add, operator.add, operator.iadd, "add", "add_"},
{torch.mul, operator.mul, operator.imul},
{torch.mul, operator.mul, operator.imul, "mul", "mul_"},
]

View File

@ -739,7 +739,7 @@ def _annotate_mul(
filter_fn: Optional[Callable[[Node], bool]] = None,
) -> Optional[List[List[Node]]]:
mul_partitions = get_source_partitions(
gm.graph, [operator.mul, torch.mul, operator.imul], filter_fn
gm.graph, ["mul", "mul_", operator.mul, torch.mul, operator.imul], filter_fn
)
mul_partitions = list(itertools.chain(*mul_partitions.values()))
annotated_partitions = []