Skip to content

Commit c7e6b61

Browse files
committed
- Fixed runtime option for profile_level
1 parent 8e5632a commit c7e6b61

3 files changed

Lines changed: 6 additions & 12 deletions

File tree

backends/qualcomm/partition/qnn_partitioner.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,9 @@ def check_partitions(
206206
) -> bool:
207207
pl = len(partitions)
208208
if backend == QnnExecuTorchBackendType.kLpaiBackend:
209-
# By default, there are two partitions that are always created in LPAI backend:
210-
# one for the quantized and one for the dequantized.
211-
bypass_nodes = [
212-
node
213-
for partition in partitions
214-
for node in partition.nodes
215-
if node.meta.get(QCOM_BYPASS_NODE, False)
216-
]
217-
pl -= len(bypass_nodes)
209+
assert (
210+
pl != 1
211+
), "LPAI backend only supports fully delegation due to the accuracy issue of Q/DQ in the LPAI backend."
218212
if pl == 0:
219213
logging.warning("Nothing can be partitioned!")
220214
else:

backends/qualcomm/runtime/backends/QnnBackendFactory.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ std::unique_ptr<BackendConfigParameters> QnnBackendFactory::Create(
120120
implementation_ptr,
121121
qnn_backend_ptr,
122122
backend_params->qnn_context_ptr_.get(),
123-
options->profile_level(),
123+
get_option(options->profile_level(), QNN_RUNTIME_PROFILE_LEVEL),
124124
gpu_options);
125125
} break;
126126
case QnnExecuTorchBackendType::kLpaiBackend: {
@@ -163,7 +163,7 @@ std::unique_ptr<BackendConfigParameters> QnnBackendFactory::Create(
163163
implementation_ptr,
164164
qnn_backend_ptr,
165165
backend_params->qnn_context_ptr_.get(),
166-
options->profile_level(),
166+
get_option(options->profile_level(), QNN_RUNTIME_PROFILE_LEVEL),
167167
lpai_options);
168168
} break;
169169
case QnnExecuTorchBackendType::kDspBackend:

examples/qualcomm/executor_runner/qnn_executor_runner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ DEFINE_int32(
130130
DEFINE_int32(
131131
lpai_core_selection,
132132
0,
133-
"Specify the core number from 1 or 2. "
133+
"Specifies which core(s) to select. "
134134
"1: selects core 0; 2: selects core 1. "
135135
"This is a runtime option and will override the core selection set during AOT. "
136136
"Refer to QnnExecuTorchLpaiBackendOptions under qc_compiler_spec.fbs for more info.");

0 commit comments

Comments
 (0)