mediapipe
mediapipe copied to clipboard
Error loading gemma gpu model in latest sample code android
Testing device:
Pixel 4
Testing model:
gemma-2b-it-gpu-int4.bin and other gpu models
Log:
Load model error: internal: Failed to initialize engine: %sUNKNOWN: Failed to build program executable - Build program failureBC-src-code:53:18: error: no matching builtin function for call to 'sub_group_broadcast' ... ^ 2025-03-06 15:44:54.372 17164-17239 com.google...renceModel com...diapipe.examples.llminference E BC-src-code:53:18: note: candidate function not viable: no known conversion from 'half4' to 'unsigned long' for 1st argument; r0 += src0.x * sub_group_broadcast(weights_cache_wave_var0, 0u); ^ BC-src-code:74:18: error: no matching builtin function for call to 'sub_group_broadcast' r1 += src1.y * sub_group_broadcast(weights_cache_wave_var2, 5u); ^~~~~~~~~~~~~~~~~~~ BC-src-code:53:18: note: candidate function not viable: no known conversion from 'half4' to 'int' for 1st argument; r0 += src0.x * sub_group_broadcast(weights_cache_wave_var0, 0u); ^ BC-src-code:53:18: note: candidate function not viable: no known conversion from 'half4' to 'unsigned int' for 1st argument; r0 += src0.x * sub_group_broadcast(weights_cache_wave_var0, 0u); ^ BC-src-code:53:18: note: candidate function not viable: no known conversion from 'half4' to 'long' for 1st argument; r0 += src0.x * sub_group_broadcast(weights_cache_wave_var0, 0u); ^ BC-src-code:53:18: note: candidate function not viable: no known conversion from 'half4' to 'unsigned long' for 1st argument; r0 += src0.x * sub_group_broadcast(weights_cache_wave_var0, 0u); ^ BC-src-code:75:18: error: no matching builtin function for call to BC-src-code:53:18: note: candidate function not viable: no known conversion from 'half4' to 'unsigned long' for 1st argument; r0 += src0.x * sub_group_broadcast(weights_cache_wave_var0, 0u); ^ 32 diagnostic(s) generated.
at com.google.mediapipe.tasks.core.LlmTaskRunner.nativeCreateEngine(Native Method)
at com.google.mediapipe.tasks.core.LlmTaskRunner.<init>(LlmTaskRunner.java:168)
2025-03-06 15:44:54.373 17164-17239 com.google...renceModel com...diapipe.examples.llminference E at com.google.mediapipe.tasks.genai.llminference.LlmInference.
I am facing the same issue, if we copy the model downloaded from kaggle https://www.kaggle.com/models/google/gemma-2/tfLite/gemma2-2b-it-gpu-int8, not able to load the model, it says the below error:
Load model error: internal: Failed to initialize engine: %sINVALID_ARGUMENT: It's no longer supported to load from directory, please consider convert it to a single-file asset.
com.google.mediapipe.framework.MediaPipeException: internal: Failed to initialize engine: %sINVALID_ARGUMENT: It's no longer supported to load from directory, please consider convert it to a single-file asset.
at com.google.mediapipe.tasks.core.LlmTaskRunner.nativeCreateEngine(Native Method)
at com.google.mediapipe.tasks.core.LlmTaskRunner.
@affereaflaw Me too encountered the same issue. It seems to be an issue related to LiteRT OpenCL backend compilation.
My test device is with Snapdragon 8 Gen 3 core.
@huangzhengxiang it was all normal for genai 0.10.20 but when i updated to v21, gpu models wouldn't run
@affereaflaw Yes! same for me!