Skip to content

Commit f327bbb

Browse files
author
quic_calvnguy
committed
Address PR comments, add HTP backend in example code
1 parent dbc9d6f commit f327bbb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/execution-providers/QNN-ExecutionProvider.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,10 @@ import onnxruntime as ort
456456
import numpy as np
457457

458458
provider_options = [
459+
"backend_path": "path/to/QnnHtp.dll", # Use libQnnHtp.so if on Linux
459460
"htp_performance_mode": "burst",
460461
"device_id": "0",
461-
"htp_graph_finalization_optimization_mode":"3"
462+
"htp_graph_finalization_optimization_mode":"3",
462463
"soc_model": "60",
463464
"htp_arch": "73",
464465
"vtcm_mv": "8",
@@ -503,9 +504,10 @@ import onnxruntime as ort
503504
import numpy as np
504505

505506
provider_options = [
507+
"backend_path": "path/to/QnnHtp.dll", # Use libQnnHtp.so if on Linux
506508
"htp_performance_mode": "burst",
507509
"device_id": "0",
508-
"htp_graph_finalization_optimization_mode":"3"
510+
"htp_graph_finalization_optimization_mode":"3",
509511
"soc_model": "60",
510512
"htp_arch": "73",
511513
"vtcm_mv": "8",
@@ -516,7 +518,6 @@ provider_options = [
516518
sess_options = ort.SessionOptions()
517519

518520
# Enable context bin generation
519-
sess_options.add_session_config_entry("session.disable_cpu_ep_fallback", "1")
520521
sess_options.add_session_config_entry("ep.context_embed_mode", "0")
521522
sess_options.add_session_config_entry("ep.context_enable", "1")
522523

@@ -531,7 +532,7 @@ session = ort.InferenceSession(
531532
Upon successful session creation, three files will be generated:
532533
- model_ctx.onnx
533534
- model_qnn.bin
534-
- QNNExecutionProvider_QNN__<number>_schematic.bin
535+
- QNNExecutionProvider_QNN_\<number\>_schematic.bin
535536

536537
model_ctx.onnx is an onnx model with a node that points to the model_qnn.bin context binary, which will be used by the HTP backend for execution. The _schematic.bin file will be used by qnn-profile-viewer to generate QHAS data.
537538

0 commit comments

Comments
 (0)