-
Notifications
You must be signed in to change notification settings - Fork 539
Cannot run .pte generated with Python in C++ #9763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Looks like your build isnt linking in the operator library. cc @larryliu0820 Can you share how you are building the cpp target @ergo70 ? |
@ergo70 can you attach your CMakeLists.txt? |
That's how I build executorch with CMake and the original CMakeLists.txt that comes from the repo:
And my example:
|
@ergo70 can you link |
I have tried this to link against
The Python module and the native libraries were built from the same source, and the .pte was built with that exact same python module. The build throws no warnings or errors. But no change to the runtime errors. |
For runtime to work you need to use |
For example:
|
Thank you, now it almost works with:
I have another runtime error now, but at least it basically runs.
|
ok thank you closing it. |
🐛 Describe the bug
Hello all,
I have built executorch on Linux according to the tutorials. I can run the export example:
And run the exported .pte in Python:
However, when I try to run it from C++:
I get these errors:
E 00:00:00.000321 executorch:operator_registry.cpp:185] kernel 'aten::add.out' not found.
E 00:00:00.000333 executorch:operator_registry.cpp:186] dtype: 6 | dim order: [
E 00:00:00.000334 executorch:operator_registry.cpp:186] 0,
E 00:00:00.000335 executorch:operator_registry.cpp:186] ]
E 00:00:00.000336 executorch:operator_registry.cpp:186] dtype: 6 | dim order: [
E 00:00:00.000336 executorch:operator_registry.cpp:186] 0,
E 00:00:00.000337 executorch:operator_registry.cpp:186] ]
E 00:00:00.000347 executorch:operator_registry.cpp:186] dtype: 6 | dim order: [
E 00:00:00.000349 executorch:operator_registry.cpp:186] 0,
E 00:00:00.000350 executorch:operator_registry.cpp:186] ]
E 00:00:00.000351 executorch:operator_registry.cpp:186] dtype: 6 | dim order: [
E 00:00:00.000359 executorch:operator_registry.cpp:186] 0,
E 00:00:00.000360 executorch:operator_registry.cpp:186] ]
E 00:00:00.000360 executorch:method.cpp:554] Missing operator: [0] aten::add.out
E 00:00:00.000362 executorch:method.cpp:763] There are 1 instructions don't have corresponding operator registered. See logs for details
E 00:00:00.000387 executorch:operator_registry.cpp:185] kernel 'aten::add.out' not found.
E 00:00:00.000395 executorch:operator_registry.cpp:186] dtype: 6 | dim order: [
E 00:00:00.000396 executorch:operator_registry.cpp:186] 0,
E 00:00:00.000397 executorch:operator_registry.cpp:186] ]
E 00:00:00.000398 executorch:operator_registry.cpp:186] dtype: 6 | dim order: [
E 00:00:00.000399 executorch:operator_registry.cpp:186] 0,
E 00:00:00.000400 executorch:operator_registry.cpp:186] ]
E 00:00:00.000401 executorch:operator_registry.cpp:186] dtype: 6 | dim order: [
E 00:00:00.000402 executorch:operator_registry.cpp:186] 0,
E 00:00:00.000402 executorch:operator_registry.cpp:186] ]
E 00:00:00.000404 executorch:operator_registry.cpp:186] dtype: 6 | dim order: [
E 00:00:00.000405 executorch:operator_registry.cpp:186] 0,
E 00:00:00.000406 executorch:operator_registry.cpp:186] ]
E 00:00:00.000407 executorch:method.cpp:554] Missing operator: [0] aten::add.out
E 00:00:00.000407 executorch:method.cpp:763] There are 1 instructions don't have corresponding operator registered. See logs for details
E 00:00:00.000414 executorch:operator_registry.cpp:185] kernel 'aten::add.out' not found.
E 00:00:00.000422 executorch:operator_registry.cpp:186] dtype: 6 | dim order: [
E 00:00:00.000423 executorch:operator_registry.cpp:186] 0,
E 00:00:00.000424 executorch:operator_registry.cpp:186] ]
E 00:00:00.000425 executorch:operator_registry.cpp:186] dtype: 6 | dim order: [
E 00:00:00.000427 executorch:operator_registry.cpp:186] 0,
E 00:00:00.000428 executorch:operator_registry.cpp:186] ]
E 00:00:00.000429 executorch:operator_registry.cpp:186] dtype: 6 | dim order: [
E 00:00:00.000437 executorch:operator_registry.cpp:186] 0,
E 00:00:00.000438 executorch:operator_registry.cpp:186] ]
E 00:00:00.000439 executorch:operator_registry.cpp:186] dtype: 6 | dim order: [
E 00:00:00.000440 executorch:operator_registry.cpp:186] 0,
E 00:00:00.000441 executorch:operator_registry.cpp:186] ]
E 00:00:00.000441 executorch:method.cpp:554] Missing operator: [0] aten::add.out
E 00:00:00.000443 executorch:method.cpp:763] There are 1 instructions don't have corresponding operator registered. See logs for details
Any suggestions what the problem might be?
Versions
PyTorch version: 2.6.0+cpu
Is debug build: False
CUDA used to build PyTorch: Could not collect
ROCM used to build PyTorch: N/A
OS: Ubuntu 24.04.2 LTS (x86_64)
GCC version: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
Clang version: Could not collect
CMake version: version 3.31.6
Libc version: glibc-2.39
Python version: 3.12.3 (main, Feb 4 2025, 14:48:35) [GCC 13.3.0] (64-bit runtime)
Python platform: Linux-5.15.167.4-microsoft-standard-WSL2-x86_64-with-glibc2.39
Is CUDA available: False
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3060
Nvidia driver version: 572.83
cuDNN version: Could not collect
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): 24
On-line CPU(s) list: 0-23
Vendor ID: GenuineIntel
Model name: 12th Gen Intel(R) Core(TM) i9-12900K
CPU family: 6
Model: 151
Thread(s) per core: 2
Core(s) per socket: 12
Socket(s): 1
Stepping: 2
BogoMIPS: 6374.39
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves avx_vnni umip waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize flush_l1d arch_capabilities
Virtualization: VT-x
Hypervisor vendor: Microsoft
Virtualization type: full
L1d cache: 576 KiB (12 instances)
L1i cache: 384 KiB (12 instances)
L2 cache: 15 MiB (12 instances)
L3 cache: 30 MiB (1 instance)
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: Mitigation; Enhanced IBRS
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
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] executorch==0.5.0a0+1bc0699
[pip3] numpy==2.0.0
[pip3] torch==2.6.0+cpu
[pip3] torchao==0.8.0+gitebc43034
[pip3] torchaudio==2.6.0
[pip3] torchsr==1.0.4
[pip3] torchvision==0.21.0+cpu
[conda] Could not collect
cc @larryliu0820 @jathu @lucylq
The text was updated successfully, but these errors were encountered: