In our attempt to deploy the Qualcomm AI Stack Stable Diffusion Demo, we found that in the example provided at https://docs.qualcomm.com/bundle/publicresource/topics/80-64748-1/model_prep_linux.html, the target platform for generating the QNN model library is x86_64-linux. However, when we followed this process to compile and generate the context binary file, we discovered that this binary file could not be loaded and run for inference on the aarch64_android Snapdragon 8Gne2 smartphone. The error encountered was:
Create From Binary failure.
The command executed originated from: https://docs.qualcomm.com/bundle/publicresource/topics/80-64748-1/model_execution_android.html
If we changed the target platform for generating the QNN model library to "aarch64_android", it would then get stuck during the generation of the context binary.
We are using AI Engine version 2.19, and for quantizing the SD model, AIMet version 1.31.0 was employed.
Refer to the following commands for guidance:
ai_engine_2.19/bin/x86_64-linux-clang/qnn-context-binary-generator --model ai_engine_2.19/SD_ori/converted_text_encoder/aarch64-android/libtext_encoder.so --backend libQnnHtp.so --output_dir ai_engine_2.19/SD_ori/serialized_binaries --binary_file text_encoder.serialized --config_file ./tmp/htp_backend_extensions.json --log_level verboseai_engine_2.19/bin/x86_64-linux-clang/qnn-context-binary-generator --model ai_engine_2.19/SD_ori/converted_text_encoder/aarch64-android/libtext_encoder.so --backend libQnnHtp.so --output_dir ai_engine_2.19/SD_ori/serialized_binaries --binary_file text_encoder.serialized --config_file ./tmp/htp_backend_extensions.json --log_level verboseai_engine_2.19/bin/x86_64-linux-clang/qnn-context-binary-generator --model ai_engine_2.19/SD_ori/converted_text_encoder/aarch64-android/libtext_encoder.so --backend libQnnHtp.so --output_dir ai_engine_2.19/SD_ori/serialized_binaries --binary_file text_encoder.serialized --config_file ./tmp/htp_backend_extensions.json --log_level verbose