executorch icon indicating copy to clipboard operation
executorch copied to clipboard

ModuleNotFoundError: No module named 'executorch.backends.qualcomm.python'

Open ThreeD-H opened this issue 11 months ago • 5 comments

🐛 Describe the bug

An error was reported when building from source code git clone -b viable/strict https://github.com/pytorch/executorch.git cd executorch conda create -yn executorch python=3.10.0 conda activate executorch ./install_executorch.sh python examples/qualcomm/oss_scripts/qwen2_5/qwen2_5.py -m SA8295 -b build-android --max_seq_len 128 --compile_only --decoder_model qwen2.5_0.5B_instruct" --artifact ./output -P 16a8w ModuleNotFoundError: No module named 'executorch.backends.qualcomm.python' Meanwhile, I use CMAKE_ARGS="-DEXECUTORCH_BUILD_QNN=ON" ./install_executorch.sh Encountered the following errors [ 76%] Building C object backends/xnnpack/third-party/XNNPACK/CMakeFiles/xnnpack-microkernels-prod.dir/src/tables/vlog.c.o [ 76%] Linking C static library libxnnpack-microkernels-prod.a [ 76%] Built target xnnpack-microkernels-prod gmake[1]: *** [CMakeFiles/Makefile2:2294:CMakeFiles/portable_lib.dir/rule] 错误 2 gmake: *** [Makefile:241:portable_lib] 错误 2

× Building wheel for executorch (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> No available output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Versions

Collecting environment information... PyTorch version: 2.10.0.dev20251025+cpu Is debug build: False CUDA used to build PyTorch: Could not collect ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.5 LTS (x86_64) GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04.2) 11.4.0 Clang version: 14.0.0-1ubuntu1.1 CMake version: version 3.31.10 Libc version: glibc-2.35

Python version: 3.10.12 (main, Nov 4 2025, 08:48:33) [GCC 11.4.0] (64-bit runtime) Python platform: Linux-6.8.0-90-generic-x86_64-with-glibc2.35 Is CUDA available: False CUDA runtime version: 11.5.119 CUDA_MODULE_LOADING set to: N/A GPU models and configuration: GPU 0: Quadro P4000 Nvidia driver version: 580.95.05 cuDNN version: Could not collect Is XPU available: False HIP runtime version: N/A MIOpen runtime version: N/A Is XNNPACK available: True Caching allocator config: N/A

CPU: 架构: x86_64 CPU 运行模式: 32-bit, 64-bit Address sizes: 46 bits physical, 48 bits virtual 字节序: Little Endian CPU: 8 在线 CPU 列表: 0-7 厂商 ID: GenuineIntel 型号名称: Intel(R) Xeon(R) Gold 5122 CPU @ 3.60GHz CPU 系列: 6 型号: 85 每个核的线程数: 2 每个座的核数: 4 座: 1 步进: 4 CPU 最大 MHz: 3700.0000 CPU 最小 MHz: 1200.0000 BogoMIPS: 7200.00 标记: 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 pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 pti intel_ppin ssbd mba ibrs ibpb stibp tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req vnmi pku ospke md_clear flush_l1d arch_capabilities ibpb_exit_to_user 虚拟化: VT-x L1d 缓存: 128 KiB (4 instances) L1i 缓存: 128 KiB (4 instances) L2 缓存: 4 MiB (4 instances) L3 缓存: 16.5 MiB (1 instance) NUMA 节点: 1 NUMA 节点0 CPU: 0-7 Vulnerability Gather data sampling: Mitigation; Microcode Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable Vulnerability Meltdown: Mitigation; PTI Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable Vulnerability Reg file data sampling: Not affected Vulnerability Retbleed: Mitigation; IBRS 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; IBRS; IBPB conditional; STIBP conditional; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Mitigation; Clear CPU buffers; SMT vulnerable Vulnerability Vmscape: Mitigation; IBPB before exit to userspace

Versions of relevant libraries: [pip3] executorch==1.1.0a0+b6935ad [pip3] numpy==2.2.6 [pip3] pytorch_tokenizers==1.0.1 [pip3] torch==2.10.0.dev20251025+cpu [pip3] torchao==0.14.0+git01849b2b1 [pip3] torchaudio==2.10.0.dev20251025+cpu [pip3] torchdata==0.11.0 [pip3] torchsr==1.0.4 [pip3] torchtune==0.6.1 [pip3] torchvision==0.25.0.dev20251025+cpu [conda] No relevant packages

cc @cccclai @cbilgin

ThreeD-H avatar Dec 18 '25 06:12 ThreeD-H

cc: @cccclai since this appears to be regarding Qualcomm.

SS-JIA avatar Dec 18 '25 17:12 SS-JIA

Thanks for trying out, can you follow the instruction in https://docs.pytorch.org/executorch/1.0/backends-qualcomm.html to have the qnn backend installed? I believe you're missing this step ./backends/qualcomm/scripts/build.sh. Also reminder to set the environment variable correctly.

Also, since exporting the qwen model will take a long time, can you try a simple model https://github.com/pytorch/executorch/tree/main/examples/qualcomm#simple-examples-to-verify-the-backend-is-working before running the whole flow.

cccclai avatar Dec 18 '25 17:12 cccclai

Thanks for trying out, can you follow the instruction in https://docs.pytorch.org/executorch/1.0/backends-qualcomm.html to have the qnn backend installed? I believe you're missing this step ./backends/qualcomm/scripts/build.sh. Also reminder to set the environment variable correctly.

Also, since exporting the qwen model will take a long time, can you try a simple model https://github.com/pytorch/executorch/tree/main/examples/qualcomm#simple-examples-to-verify-the-backend-is-working before running the whole flow.

./backends/qualcomm/scripts/build.sh ->successful execution python export_example.py -m add -g ->output import executorch.backends.qualcomm.python.PyQnnWrapperAdaptor as PyQnnWrapper ModuleNotFoundError: No module named 'executorch.backends.qualcomm.python'

ThreeD-H avatar Dec 19 '25 01:12 ThreeD-H

May I know have you set export PYTHONPATH=$EXECUTORCH_ROOT/..? https://docs.pytorch.org/executorch/1.0/backends-qualcomm.html#setup-environment-variables

shewu-quic avatar Dec 19 '25 02:12 shewu-quic

May I know have you set export PYTHONPATH=$EXECUTORCH_ROOT/..? https://docs.pytorch.org/executorch/1.0/backends-qualcomm.html#setup-environment-variables

Yes, I did miss this. Now I can work normally. Thank you for your reply

ThreeD-H avatar Dec 19 '25 02:12 ThreeD-H