xref: /aosp_15_r20/external/executorch/examples/xnnpack/__init__.py (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
1# Copyright (c) Meta Platforms, Inc. and affiliates.
2# All rights reserved.
3#
4# This source code is licensed under the BSD-style license found in the
5# LICENSE file in the root directory of this source tree.
6
7# pyre-unsafe
8
9from dataclasses import dataclass
10
11
12@dataclass
13class XNNPACKOptions(object):
14    quantization: bool
15    delegation: bool
16
17
18MODEL_NAME_TO_OPTIONS = {
19    "linear": XNNPACKOptions(True, True),
20    "add": XNNPACKOptions(True, True),
21    "add_mul": XNNPACKOptions(True, True),
22    "dl3": XNNPACKOptions(True, True),
23    "ic3": XNNPACKOptions(True, True),
24    "ic4": XNNPACKOptions(True, True),
25    "mv2": XNNPACKOptions(True, True),
26    "mv3": XNNPACKOptions(True, True),
27    "resnet18": XNNPACKOptions(True, True),
28    "resnet50": XNNPACKOptions(True, True),
29    "vit": XNNPACKOptions(True, True),
30    "w2l": XNNPACKOptions(True, True),
31    "edsr": XNNPACKOptions(True, True),
32    "mobilebert": XNNPACKOptions(True, True),
33    "llama2": XNNPACKOptions(False, True),
34    "emformer_join": XNNPACKOptions(True, True),
35    "emformer_predict": XNNPACKOptions(True, True),
36    "emformer_transcribe": XNNPACKOptions(True, True),
37}
38
39
40__all__ = [MODEL_NAME_TO_OPTIONS]
41