Skip to content

LLAMA Runner with QNN Build Failure in Recent Push #4201

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

Closed
mattsbryson opened this issue Jul 10, 2024 · 5 comments
Closed

LLAMA Runner with QNN Build Failure in Recent Push #4201

mattsbryson opened this issue Jul 10, 2024 · 5 comments
Assignees
Labels
partner: qualcomm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Qualcomm triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@mattsbryson
Copy link

🐛 Describe the bug

A recent update to main (within this month) has introduced a bug in the build process for the AOT components of the LLAMA runner with the QNN flag turned on. This bug was produced on 561c035 (head). Rolling back to a late June commit solves this particular issue.

executorch/backends/qualcomm/runtime/QnnManager.cpp:324:18: error: no member named 'is_from_context_binary' in 'qnn_delegate::QnnExecuTorchOptions'
if (!options_->is_from_context_binary()) {
~~~~~~~~ ^
executorch/backends/qualcomm/runtime/QnnManager.cpp:348:18: error: no member named 'is_from_context_binary' in 'qnn_delegate::QnnExecuTorchOptions'
if (!options_->is_from_context_binary())

Versions

Vulnerability Meltdown: Mitigation; PTI
Vulnerability Mmio stale data: Unknown: No mitigations
L1i cache: 512 KiB
L2 cache: 4 MiB
L3 cache: 40 MiB
NUMA node0 CPU(s): 0-7,16-23
NUMA node1 CPU(s): 8-15,24-31
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit: KVM: Mitigation: Split huge pages
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: Unknown: No mitigations
Vulnerability Retbleed: 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; Retpolines, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
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 arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm epb pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm ida arat pln pts md_clear flush_l1d

Versions of relevant libraries:
[pip3] executorch==0.3.0a0+7c0f4c2
[pip3] numpy==1.26.4
[pip3] torch==2.5.0.dev20240618+cpu
[pip3] torchao==0.1
[pip3] torchaudio==2.4.0.dev20240618+cpu
[pip3] torchsr==1.0.4
[pip3] torchvision==0.20.0.dev20240618+cpu
[conda] executorch 0.3.0a0+7c0f4c2 pypi_0 pypi
[conda] numpy 1.26.4 pypi_0 pypi
[conda] torch 2.5.0.dev20240618+cpu pypi_0 pypi
[conda] torchao 0.1 pypi_0 pypi
[conda] torchaudio 2.4.0.dev20240618+cpu pypi_0 pypi
[conda] torchsr 1.0.4 pypi_0 pypi
[conda] torchvision 0.20.0.dev20240618+cpu pypi_0 pypi

@lucylq lucylq added the partner: qualcomm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Qualcomm label Jul 11, 2024
@lucylq
Copy link
Contributor

lucylq commented Jul 11, 2024

@cccclai do you mind taking a look at this?

@cccclai
Copy link
Contributor

cccclai commented Jul 11, 2024

That's like from #4142

Can you rebuild the library and try again?

@mattsbryson
Copy link
Author

Thanks for your help! I tried to rebuild on the latest commit to main, but got the same build error. In case they're useful, here are my build steps.

  1. Build AOT libs:

    cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake
    -DANDROID_ABI=arm64-v8a
    -DANDROID_PLATFORM=android-23
    -DCMAKE_INSTALL_PREFIX=cmake-out-android
    -DCMAKE_BUILD_TYPE=Release
    -DEXECUTORCH_BUILD_EXTENSION_MODULE=ON
    -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON
    -DEXECUTORCH_ENABLE_LOGGING=1
    -DPYTHON_EXECUTABLE=python
    -DEXECUTORCH_BUILD_XNNPACK=ON
    -DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON
    -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=OFF
    -DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON
    -DEXECUTORCH_BUILD_QNN=ON
    -DQNN_SDK_ROOT=$QNN_SDK_ROOT
    -Bcmake-out-android .

  2. Hack this into the cmake cache file:

echo "QNN_SDK_ROOT=$QNN_SDK_ROOT" >> /scratch/executorch/CMakeCache.txt

  1. Build libraries

cmake --build cmake-out-android -j16 --target install --config Release

  1. Build runner:

    cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake
    -DANDROID_ABI=arm64-v8a
    -DANDROID_PLATFORM=android-23
    -DCMAKE_INSTALL_PREFIX=cmake-out-android
    -DCMAKE_BUILD_TYPE=Release
    -DPYTHON_EXECUTABLE=python
    -DEXECUTORCH_BUILD_XNNPACK=OFF
    -DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON
    -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=OFF
    -DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON
    -DEXECUTORCH_USE_TIKTOKEN=ON
    -DEXECUTORCH_BUILD_QNN=ON
    -Bcmake-out-android/examples/models/llama2
    examples/models/llama2

cmake --build cmake-out-android/examples/models/llama2 -j16 --config Release

@lucylq lucylq added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Jul 11, 2024
@chiwwang
Copy link
Contributor

Hi @mattsbryson ,
I tried around and it seems this error can occur if we don't cleanup cmake folder after updating codebase.
Could you try a fresh build please?

@mattsbryson
Copy link
Author

Thanks, that did the trick! My apologizes for not trying that this time - I had with other build errors, but perhaps not this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
partner: qualcomm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Qualcomm triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

4 participants