MCPcopy Create free account
hub / github.com/pytorch/executorch / QnnConfig

Class QnnConfig

backends/qualcomm/export_utils.py:67–202  ·  view source on GitHub ↗

A configuration used as input to QNN ExecuTorch’s lowering API. This config initialization currently supports: 1. Provide command-line arguments paired with setup_common_args_and_variables. 2. Provide a json file that stores desired config. Attributes: backend (str): Th

Source from the content-addressed store, hash-verified

65
66@dataclass
67class QnnConfig:
68 """
69 A configuration used as input to QNN ExecuTorch’s lowering API.
70 This config initialization currently supports:
71 1. Provide command-line arguments paired with setup_common_args_and_variables.
72 2. Provide a json file that stores desired config.
73
74 Attributes:
75 backend (str): The target backend, such as htp, gpu, etc. QnnConfig will then parse this to type QnnExecuTorchBackendType.
76 soc_model (QcomChipset): The target Qualcomm System on Chip (SoC) model.
77 build_folder (str): Path to cmake binary directory for target platform, e.g., /path/to/build-android.
78 direct_build_folder (str): Path to cmake binary directory for direct_mode. E.g., path/to/build-direct.
79 target (str): Target platform for deployment.
80 online_prepare (bool): Compose QNN graph on device if set to True.
81 shared_buffer (bool): Enables usage of shared buffer(zero-copy mechanism) between application and backend for graph I/O during runtime.
82 dump_intermediate_outputs (bool): Enables dumping model intermediate outputs.
83 profile_level (int): Level of profiling in runtime.
84 enable_x86_64: Enable x86_64 simulator execution.
85 host (str): Hostname where android device is connected.
86 device (str): Serial number for android device communicated via ADB.
87 port (int): IPC port for delivering execution result
88 ip (str): IPC address for delivering execution result.
89 skip_delegate_node_ids (str): If specified, skip delegation for the specified node based on node ids. Node ids should be separated by comma. e.g., aten_relu_default_10,aten_relu_default_2
90 skip_delegate_node_ops (str): If specified, skip delegation for the specified op. Node ops should be separated by comma. e.g., aten.add.Tensor,aten.relu.default
91 compile_only (bool): If specified, only compile the model.
92 pre_gen_pte (str): Run the pre-generated pte in the given directory.
93 skip_push: If specified, skip pushing files to device. Assumes all required files are on device already.
94 ci (bool): This flag is for Continuous Integration(CI) purpose and is NOT recommended to turn on for typical use cases. It will use random inputs instead of real inputs.
95 seed (int): Set the seed for generating random numbers in both torch and random.
96 htp_performance_mode (QnnExecuTorchHtpPerformanceMode, optional): Option to set the performance mode for htp backend.
97 """
98
99 soc_model: str
100 build_folder: str
101 direct_build_folder: Optional[str] = None
102 backend: str = "htp"
103 target: str = "aarch64-android"
104 online_prepare: Optional[bool] = False
105 shared_buffer: Optional[bool] = False
106 dump_intermediate_outputs: Optional[bool] = False
107 profile_level: Optional[int] = 0
108 enable_x86_64: Optional[bool] = False
109 host: Optional[str] = None
110 device: Optional[str] = None
111 port: Optional[str] = -1
112 ip: Optional[str] = ""
113 skip_delegate_node_ids: Optional[str] = None
114 skip_delegate_node_ops: Optional[str] = None
115 compile_only: Optional[bool] = False
116 pre_gen_pte: Optional[str] = None
117 skip_push: Optional[bool] = False
118 ci: Optional[bool] = False
119 seed: Optional[int] = None
120 htp_performance_mode: QnnExecuTorchHtpPerformanceMode = (
121 QnnExecuTorchHtpPerformanceMode.kHtpBurst
122 )
123
124 def __post_init__(self):

Callers 6

setUpClassMethod · 0.90
verify_outputMethod · 0.90
get_adb_toolMethod · 0.90
executeFunction · 0.90
__init__Method · 0.90
to_context_binaryFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected