From b274e0ee4c79ec313d47aec9420b164561ef3c48 Mon Sep 17 00:00:00 2001 From: Chen Lai Date: Thu, 17 Oct 2024 14:54:05 -0700 Subject: [PATCH] Back out "Revert D64082731" Summary: Original commit changeset: 0f02a7dff4f1 Original Phabricator Diff: D64507094 Differential Revision: D64565807 --- backends/qualcomm/utils/utils.py | 8 ++++---- examples/qualcomm/utils.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backends/qualcomm/utils/utils.py b/backends/qualcomm/utils/utils.py index 298664e2c96..88a84f2f9a6 100644 --- a/backends/qualcomm/utils/utils.py +++ b/backends/qualcomm/utils/utils.py @@ -7,7 +7,7 @@ import operator import warnings from collections import OrderedDict -from typing import Callable, Dict, List, Set, Tuple +from typing import Callable, Dict, FrozenSet, List, Set, Tuple import executorch.backends.qualcomm.python.PyQnnManagerAdaptor as PyQnnManagerAdaptor @@ -291,9 +291,8 @@ def get_decomp_table() -> Dict[torch._ops.OperatorBase, Callable]: def _transform( - edge_program: ExportedProgram, custom_pass_config: Set[str] = None -) -> None: - custom_pass_config = custom_pass_config or {} + edge_program: ExportedProgram, custom_pass_config: FrozenSet[str] = frozenset() +) -> ExportedProgram: # currently ExirExportedProgram.transform does not accept # changes of input number which was caused by FoldQDQ # apply passes one by one here to avoid IR capture failure @@ -325,6 +324,7 @@ def _transform( edge_program.graph_module, ) edge_program._validate() + return edge_program def capture_program( diff --git a/examples/qualcomm/utils.py b/examples/qualcomm/utils.py index 27c9db2ffcc..06225be2d1c 100755 --- a/examples/qualcomm/utils.py +++ b/examples/qualcomm/utils.py @@ -234,7 +234,7 @@ def build_executorch_binary( shared_buffer=False, metadata=None, dump_intermediate_outputs=False, - custom_pass_config=None, + custom_pass_config=frozenset(), ): if quant_dtype is not None: quantizer = custom_quantizer or make_quantizer(quant_dtype=quant_dtype)