QNN backend Compilation
@winskuo-quic is already working on this.
Since Feb 24, 2025.
- Dominant language
- Python
- Stars
- 5k
- Forks
- 1.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 581
Description
🐛 Describe the bug
converting .pte for llama3.2-1b SM8650 soc
: Failed to interpret QNN context binary. Error code 30010. Try verifying binary with online-prepare format.
[WARNING] [Qnn ExecuTorch]: QnnDsp Performance Estimates unsupported
[WARNING] [Qnn ExecuTorch]: QnnDsp Arch 68 set by custom config is different from arch associated with SoC 57, will overwrite it to 75
[INFO] [Qnn ExecuTorch]: Running level=3 optimization.
[INFO] [Qnn ExecuTorch]: Running level=3 optimization.
[ERROR] [Qnn ExecuTorch]: QnnDsp Dynamic tensor is not supported
[ERROR] [Qnn ExecuTorch]: QnnDsp exits with 7005, tensor parameters not supported
[ERROR] [Qnn ExecuTorch]: QnnDsp Dynamic tensor is not supported
[ERROR] [Qnn ExecuTorch]: QnnDsp exits with 7005, tensor parameters not supported
[ERROR] [Qnn ExecuTorch]: QnnDsp Dynamic tensor is not supported
[ERROR] [Qnn ExecuTorch]: QnnDsp exits with 7005, tensor parameters not supported
[ERROR] [Qnn ExecuTorch]: QnnDsp Did not find registered tensor (input) with ID 0 for aten_embedding_default
[ERROR] [Qnn ExecuTorch]: QnnDsp op config sanitization failed
[ERROR] [Qnn ExecuTorch]: Failed to add node to Qnn Graph with error: 6005
E 00:33:17.663831 executorch:QnnManager.cpp:599] Fail to compile graph from qcir with graph_name: kv_forward
[ERROR] [Qnn ExecuTorch]: Fail to compile qcir
Traceback (most recent call last):
File "/home/mbulab5007/Documents/Oss/executorch/examples/qualcomm/oss_scripts/llama/llama.py", line 1151, in
main()
File "/home/mbulab5007/Documents/Oss/executorch/examples/qualcomm/oss_scripts/llama/llama.py", line 1146, in main
export_llama(args)
File "/home/mbulab5007/Documents/Oss/executorch/examples/qualcomm/oss_scripts/llama/llama.py", line 1094, in export_llama
quant_attrs = compile(args, pte_filename, tokenizer)
File "/home/mbulab5007/Documents/Oss/executorch/examples/qualcomm/oss_scripts/llama/llama.py", line 749, in compile
prog_mgr, bundle_progs = generate_multi_graph_program(
File "/home/mbulab5007/Documents/Oss/executorch/backends/qualcomm/utils/utils.py", line 924, in generate_multi_graph_program
assert len(binary_info) != 0, "failed to generate QNN context binary"
AssertionError: failed to generate QNN context binary
[INFO] [Qnn ExecuTorch]: Destroy Qnn context
[INFO] [Qnn ExecuTorch]: Destroy Qnn device
[INFO] [Qnn ExecuTorch]: Destroy Qnn backend
Versions
/Documents/Oss/executorch$ python collect_env.py
Collecting environment information...
PyTorch version: 2.7.0.dev20250131+cpu
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A
OS: Ubuntu 22.04.5 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: 14.0.0-1ubuntu1.1
CMake version: version 3.31.1
Libc version: glibc-2.35
Python version: 3.10.0 | packaged by conda-forge | (default, Nov 20 2021, 02:24:10) [GCC 9.4.0] (64-bit runtime)
Python platform: Linux-6.8.0-49-generic-x86_64-with-glibc2.35
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 46 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 32
On-line CPU(s) list: 0-31
Vendor ID: GenuineIntel
Model name: 13th Gen Intel(R) Core(TM) i9-13900KS
CPU family: 6
Model: 183
Thread(s) per core: 2
Core(s) per socket: 24
Socket(s): 1
Stepping: 1
CPU max MHz: 6000.0000
CPU min MHz: 800.0000
BogoMIPS: 6374.40
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq tme rdpid movdiri movdir64b fsrm md_clear serialize pconfig arch_lbr ibt flush_l1d arch_capabilities
Virtualization: VT-x
L1d cache: 896 KiB (24 instances)
L1i cache: 1.3 MiB (24 instances)
L2 cache: 32 MiB (12 instances)
L3 cache: 36 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-31
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Mitigation; Clear Register File
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Versions of relevant libraries:
[pip3] asyncclick==8.1.7.2
[pip3] executorch==0.6.0a0+54b371f
[pip3] flake8==6.1.0
[pip3] flake8-breakpoint==1.1.0
[pip3] flake8-bugbear==23.9.16
[pip3] flake8-comprehensions==3.14.0
[pip3] flake8-plugin-utils==1.3.3
[pip3] flake8-pyi==23.5.0
[pip3] mypy-extensions==1.0.0
[pip3] numpy==2.2.3
[pip3] nvidia-cudnn-cu12==9.1.0.70
[pip3] onnx==1.12.0
[pip3] onnxruntime==1.17.1
[pip3] onnxsim==0.4.36
[pip3] torch==2.7.0.dev20250131+cpu
[pip3] torchao==0.8.0+git11333ba2
[pip3] torchaudio==2.6.0.dev20250131+cpu
[pip3] torchgen==0.0.1
[pip3] torchsr==1.0.4
[pip3] torchtext==0.5.0
[pip3] torchvision==0.22.0.dev20250131+cpu
[pip3] triton==3.2.0
[conda] executorch 0.6.0a0+54b371f pypi_0 pypi
[conda] numpy 2.2.3 pypi_0 pypi
[conda] torch 2.7.0.dev20250131+cpu pypi_0 pypi
[conda] torchao 0.8.0+git11333ba2 pypi_0 pypi
[conda] torchaudio 2.6.0.dev20250131+cpu pypi_0 pypi
[conda] torchtext 0.5.0 pypi_0 pypi
[conda] torchvision 0.22.0.dev20250131+cpu pypi_0 pypi
[conda] triton 3.2.0 pypi_0 pypi
cc @JacobSzwejbka @dbort @cccclai @winskuo-quic @shewu-quic @cbilgin
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.