From 3c9ff0d0af20a4893760946954fa961f145115c0 Mon Sep 17 00:00:00 2001 From: Apurva Jain Date: Fri, 23 May 2025 18:33:09 -0700 Subject: [PATCH] Updates to use torchao's updated choose_qparams_affine and quantize/dequantize_affine (#11070) Summary: Updates to use torchao's updated choose_qparams_affine and quantize/dequantize_affine. Remove zero_point_domain dependency Pull Request resolved: https://github.com/pytorch/executorch/pull/11070 Reviewed By: mcr229 Differential Revision: D75228037 Pulled By: jerryzh168 --- backends/xnnpack/utils/quant_utils.py | 3 --- exir/passes/_quant_patterns_and_replacements.py | 3 --- third-party/ao | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/backends/xnnpack/utils/quant_utils.py b/backends/xnnpack/utils/quant_utils.py index cb91b78c123..12064899a7c 100644 --- a/backends/xnnpack/utils/quant_utils.py +++ b/backends/xnnpack/utils/quant_utils.py @@ -222,9 +222,6 @@ def extract_qdq_affine_op_args_for_decomposed_ops(node: torch.fx.Node): # add target_dtype_node after quant_min/quant_max args.append(target_dtype) - # zero_point_domain - if len(node.args) > 7 and node.args[7] != "INT": - return None, None if is_per_channel_group(node): block_sizes = cast(list[int], node.args[1]) diff --git a/exir/passes/_quant_patterns_and_replacements.py b/exir/passes/_quant_patterns_and_replacements.py index 2d8880cbde6..54ef522047d 100644 --- a/exir/passes/_quant_patterns_and_replacements.py +++ b/exir/passes/_quant_patterns_and_replacements.py @@ -1017,7 +1017,6 @@ def embedding_byte_dtype_pattern( torch.int8, -128, 127, - "INT", output_dtype, ) return torch.ops.aten.embedding.default(dq, indices) @@ -1062,7 +1061,6 @@ def embedding_2bit_dtype_pattern( torch.int8, -2, 1, - "INT", output_dtype, ) return torch.ops.aten.embedding.default(dq, indices) @@ -1110,7 +1108,6 @@ def embedding_4bit_dtype_pattern( torch.int8, -8, 7, - "INT", output_dtype, ) return torch.ops.aten.embedding.default(dq, indices) diff --git a/third-party/ao b/third-party/ao index 5e5db7176cb..214e70476f0 160000 --- a/third-party/ao +++ b/third-party/ao @@ -1 +1 @@ -Subproject commit 5e5db7176cb6a966b1f2a56eac86c2b83c8b189f +Subproject commit 214e70476f0093e84983ec015d1c737183e2f2ca