From 6beff9d3cb6a13cdcd5fbae1408d9be923865ab9 Mon Sep 17 00:00:00 2001 From: Scott Roy Date: Mon, 3 Mar 2025 12:13:48 -0800 Subject: [PATCH] Fix broken tests (#8888) Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/8888 Fixes tests in T216709392. Reviewed By: JacobSzwejbka Differential Revision: D70503708 --- exir/program/_program.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/exir/program/_program.py b/exir/program/_program.py index 5a9c101a06a..8295907d090 100644 --- a/exir/program/_program.py +++ b/exir/program/_program.py @@ -978,6 +978,18 @@ def _remove_invalid_ops_for_not_decompose( ) -> List[torch._ops.OpOverload]: # To address https://github.com/pytorch/executorch/issues/8781 def keep(op): + # Explicit allow list + allow_list = [] + try: + # Ops in torch.ops.quant are not always loaded, so we use try/except + # Aliases output, but we need to allow it for XNNPACK + allow_list.append(torch.ops.quant.choose_qparams_affine.default) + except: + pass + + if op in allow_list: + return True + schema = op._schema native_schema = _pybind_schema_to_native_schema(schema) if native_schema.is_mutable: