VGG16 works, but ViT-H/14 doesn't?

I’m running a modified version of the qualcomm deeplab_v3.py scripts to deploy models to a Samsung S25 with the correct SM8750 model specified. When I run a VGG16 architecture it seems to work, my quantization is horrendous, but at least it runs. However, when I run the PyTorch implemention of ViT-H/14 fine-tuned on CIFAR10 it doesn’t work? Not sure exactly what the issue is.

When I inspect the input data it looks fine.

Here is the relevant log output:

[‘adb’, ‘-s’, ‘R5CXC1V74NV’, ‘shell’, ‘cd /data/local/tmp/model/expert1/executorch/cmod_expert1_qnn_q8 && chmod +x ./qnn_executor_runner && ./qnn_executor_runner --model_path cmod_expert1_qnn_q8.pte --output_folder_path /data/local/tmp/model/expert1/executorch/cmod_expert1_qnn_q8/outputs --input_list_path input_list.txt --etdump_path /data/local/tmp/model/expert1/executorch/cmod_expert1_qnn_q8/etdump.etdp --debug_output_path /data/local/tmp/model/expert1/executorch/cmod_expert1_qnn_q8/debug_output.bin --method_index 0’]
I 00:00:00.003551 executorch:qnn_executor_runner.cpp:232] Model file cmod_expert1_qnn_q8.pte is loaded.
I 00:00:00.003571 executorch:qnn_executor_runner.cpp:242] Using method forward
I 00:00:00.003575 executorch:qnn_executor_runner.cpp:289] Setting up planned buffer 0, size 3219936.
[INFO] [Qnn ExecuTorch]: Deserializing processed data using QnnContextCustomProtocol
[INFO] [Qnn ExecuTorch]: create QNN Logger with log_level 1
[INFO] [Qnn ExecuTorch]: Initialize Qnn backend parameters for Qnn executorch backend type 2
[INFO] [Qnn ExecuTorch]: Caching: Caching is in RESTORE MODE.
[INFO] [Qnn ExecuTorch]: QnnContextCustomProtocol expected magic number: 0x5678abcd but get: 0x2000000
[INFO] [Qnn ExecuTorch]: Running level=1 optimization.
I 00:00:00.973868 executorch:qnn_executor_runner.cpp:313] Method loaded.
E 00:00:00.974553 executorch:method.cpp:1245] Output 0 is memory planned, or is a constant. Cannot override the existing data pointer.
I 00:00:00.974564 executorch:qnn_executor_runner.cpp:373] ignoring error from set_output_data_ptr(): 0x2
F 00:00:00.974567 executorch:evalue.h:278] In function toTensor(), assert failed (isTensor()): EValue is not a Tensor.
Aborted

Hmm how did you findtune the model? I feel like it might related to the changes made to the model. It seems like you also try to provide an input list. Does it work if you run the following?

qnn_executor_runner --model_path cmod_expert1_qnn_q8.pte

Mostly just use the default input and see what might be wrong

Hello, @Xavante

The crash is likely caused by the ViT model returning a Tuple (usually containing logits and an auxiliary output) instead of a single Tensor, which triggers the EValue is not a Tensor assertion in the runner. Because the qnn_executor_runner expects a direct tensor output, you should wrap your model in a simple nn.Module that explicitly returns only logits[0] to clean up the graph signature. Additionally, the “magic number” mismatch in your logs indicates a version conflict between the QNN SDK used for compilation and the libraries on your S25; you must ensure the .pte is compiled with the exact same SDK version currently installed on the device. Finally, the memory planning error suggests that because ViT-H/14 is so large, the compiler is trying to “alias” or reuse the output buffer for internal calculations to save space, which prevents the runner from binding a data pointer; disabling aggressive memory planning or ensuring the output is marked as a non-aliasable buffer during the export phase should resolve this.

This looks like a tricky setup and the logs feel hard to read at first
It seems the model works on one path but fails on another even though inputs look fine
Issues like this often come from support limits or format gaps rather than the data
Checking docs or a website example for similar models might help narrow it down

@Xavante could you check for a possible mismatch between the QNN library

  • for generating the model fine-tuned on CIFAR-10 and
  • your SM8750 device?