Skip to content

The LLAVA model loaded successfully on the Samsung S24 Ultra. After loading, when an image is fed into the model, the app crashes. FYI I am using latest code with all the steps mentioned in Repository. #6189

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

Open
Deswaluday opened this issue Oct 14, 2024 · 14 comments
Assignees
Labels
module: android Issues related to Android code, build, and execution triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@Deswaluday
Copy link

🐛 Describe the bug

The LLAVA model loaded successfully. Please check the screenshot. After an image is given as a prompt, the app crashes. Please check the logs as well. I am attaching the logs for your reference.

image

image

image

Versions

Please check the logs. I am attaching the screenshot for your reference.

Kindly help me to resolve the issue.

Thanks in advance.
logs (1).txt

@kirklandsign kirklandsign added module: android Issues related to Android code, build, and execution triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Oct 14, 2024
@WuhanMonkey
Copy link
Contributor

Hi @Deswaluday, did you build the AAR file from the same branch of this demo app? Or you are using the prebuilt AAR.

@larryliu0820
Copy link
Contributor

Just to confirm, is your prompt empty? If so this could be a bug on our side

@cmodi-meta
Copy link
Contributor

Thank you @Deswaluday for your question. As an additional tip, please make sure that your model is successfully loaded prior to selecting an image.

From the log Attempt to invoke virtual method 'long org.pytorch.executorch.LlamaModule.prefillImages(int[], int, int, int, long)' on a null object reference, it suggests that as if mModule is null. mModule is initialized when a model is successfully loaded after the user selects the Model, Tokenizer, and Prompt type from the Settings menu.

@cmodi-meta cmodi-meta self-assigned this Oct 14, 2024
@Deswaluday
Copy link
Author

Hi @Deswaluday, did you build the AAR file from the same branch of this demo app? Or you are using the prebuilt AAR.

we are using prebuilt AAR ..

@Deswaluday
Copy link
Author

Just to confirm, is your prompt empty? If so this could be a bug on our side
when i add prompt after adding the prompt the app will crash.
That is the main issue .

But in text model LLama 3.2 it is working fine.

@Deswaluday
Copy link
Author

Just to confirm, is your prompt empty? If so this could be a bug on our side

whenever i add prompt the app will crash.

@cmodi-meta
Copy link
Contributor

Thanks for the response @Deswaluday.

we are using prebuilt AAR ..

Can you confirm the following:

  1. You are using the latest prebuild AAR?: download_prebuilt_lib.sh was updated with a new aar pointer 5 days ago.
  2. Llava Model is loaded correctly prior to image selection?: Like from the previous comment, I have only be able to reproduce this exact issue when Llava is not loaded on the device and then we select an image. At this point, it tried to prefill the image but it's not able to do so because model is not loaded. Can you make sure that the Llava model is loaded and mModule is populated?

If answers to both are 'yes', then could you provide exact instructions on how to reproduce and a complete logcat for further debugging? Thanks!

@justin-Kor
Copy link

@cmodi-meta
I'm experiencing the same thing.
Tombstone Logs will be shared.

10-31 18:33:57.096 7368 7516 D ETLogging: Model loaded time: 10215 ms
10-31 18:34:29.080 7368 7643 D ETLogging: starting runnable generate()
10-31 18:34:31.048 7368 7643 D ETLogging: Inference completed
10-31 18:37:38.814 7368 7643 D ETLogging: Starting runnable prefill image
10-31 18:37:38.814 7368 7643 D ETLogging: Llava start prefill image

10-31 18:37:39.951 8239 8239 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-31 18:37:39.951 8239 8239 F DEBUG : Build fingerprint: 'samsung/e3qksx/e3q:14/UP1A.231005.007/S928NKSS3AXJ1:user/release-keys'
10-31 18:37:39.951 8239 8239 F DEBUG : Revision: '13'
10-31 18:37:39.951 8239 8239 F DEBUG : ABI: 'arm64'
10-31 18:37:39.951 8239 8239 F DEBUG : Processor: '7'
10-31 18:37:39.951 8239 8239 F DEBUG : Timestamp: 2024-10-31 18:37:39.835886596+0900
10-31 18:37:39.951 8239 8239 F DEBUG : Process uptime: 252s
10-31 18:37:39.951 8239 8239 F DEBUG : Cmdline: com.example.executorchllamademo
10-31 18:37:39.951 8239 8239 F DEBUG : pid: 7368, tid: 7643, name: pool-3-thread-1 >>> com.example.executorchllamademo <<<
10-31 18:37:39.951 8239 8239 F DEBUG : uid: 10398
10-31 18:37:39.951 8239 8239 F DEBUG : tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
10-31 18:37:39.951 8239 8239 F DEBUG : pac_enabled_keys: 000000000000000f (PR_PAC_APIAKEY, PR_PAC_APIBKEY, PR_PAC_APDAKEY, PR_PAC_APDBKEY)
10-31 18:37:39.951 8239 8239 F DEBUG : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
10-31 18:37:39.951 8239 8239 F DEBUG : Abort message: 'Scudo ERROR: CHECK failed @ external/scudo/standalone/list.h:215 (Prev->Next) == (X) ((u64)op1=18410715280977166336, (u64)op2=72058060647296944)'
10-31 18:37:39.951 8239 8239 F DEBUG : x0 0000000000000000 x1 0000000000001ddb x2 0000000000000006 x3 0000006ca5a89cb0
10-31 18:37:39.951 8239 8239 F DEBUG : x4 647377641f3f1f63 x5 647377641f3f1f63 x6 647377641f3f1f63 x7 7f7f7f7f7f7f7f7f
10-31 18:37:39.951 8239 8239 F DEBUG : x8 00000000000000f0 x9 0000006fc864d278 x10 0000000000000001 x11 0000006fc8695b60
10-31 18:37:39.951 8239 8239 F DEBUG : x12 0000000067234fe3 x13 000000007fffffff x14 0000000000368df8 x15 000000476695d107
10-31 18:37:39.951 8239 8239 F DEBUG : x16 0000006fc86fed18 x17 0000006fc86d9680 x18 0000006a48fbe000 x19 0000000000001cc8
10-31 18:37:39.951 8239 8239 F DEBUG : x20 0000000000001ddb x21 00000000ffffffff x22 00000000000000d7 x23 0000006fc864c1be
10-31 18:37:39.951 8239 8239 F DEBUG : x24 00000000000a1000 x25 b400006ca415f000 x26 00000000000a0000 x27 b400006def6470b0
10-31 18:37:39.951 8239 8239 F DEBUG : x28 0000000000000020 x29 0000006ca5a89d30
10-31 18:37:39.951 8239 8239 F DEBUG : lr 0000006fc8686704 sp 0000006ca5a89c90 pc 0000006fc8686730 pst 0000000000001000
10-31 18:37:39.951 8239 8239 F DEBUG : 48 total frames
10-31 18:37:39.951 8239 8239 F DEBUG : backtrace:
10-31 18:37:39.951 8239 8239 F DEBUG : #00 pc 000000000005b730 /apex/com.android.runtime/lib64/bionic/libc.so (abort+168) (BuildId: edc1b601d9f8344c1eccd3d77a458f65)
10-31 18:37:39.951 8239 8239 F DEBUG : #1 pc 0000000000048f20 /apex/com.android.runtime/lib64/bionic/libc.so (scudo::die()+12) (BuildId: edc1b601d9f8344c1eccd3d77a458f65)
10-31 18:37:39.951 8239 8239 F DEBUG : #2 pc 00000000000498a8 /apex/com.android.runtime/lib64/bionic/libc.so (scudo::ScopedErrorReport::~ScopedErrorReport()+36) (BuildId: edc1b601d9f8344c1eccd3d77a458f65)
10-31 18:37:39.951 8239 8239 F DEBUG : #3 pc 00000000000499c4 /apex/com.android.runtime/lib64/bionic/libc.so (scudo::reportCheckFailed(char const*, int, char const*, unsigned long, unsigned long)+168) (BuildId: edc1b601d9f8344c1eccd3d77a458f65)
10-31 18:37:39.951 8239 8239 F DEBUG : #4 pc 00000000000517a4 /apex/com.android.runtime/lib64/bionic/libc.so (scudo::MapAllocatorscudo::AndroidConfig::deallocate(scudo::Options, void*)+292) (BuildId: edc1b601d9f8344c1eccd3d77a458f65)
10-31 18:37:39.951 8239 8239 F DEBUG : #5 pc 000000000004b7d4 /apex/com.android.runtime/lib64/bionic/libc.so (scudo::Allocator<scudo::AndroidConfig, &(scudo_malloc_postinit)>::deallocate(void*, scudo::Chunk::Origin, unsigned long, unsigned long)+216) (BuildId: edc1b601d9f8344c1eccd3d77a458f65)
10-31 18:37:39.951 8239 8239 F DEBUG : #6 pc 00000000001de0b4 /data/app/~~ImJJk3ALh5n5ShLD4F8Lrg==/com.example.executorchllamademo-MlcPHIKrzFBwL18FakDLYw==/lib/arm64/libexecutorch.so (BuildId: c029051dea0ed0a950b3dfbe13e0abb308c8fffc)
10-31 18:37:39.951 8239 8239 F DEBUG : #7 pc 00000000001d7534 /data/app/~~ImJJk3ALh5n5ShLD4F8Lrg==/com.example.executorchllamademo-MlcPHIKrzFBwL18FakDLYw==/lib/arm64/libexecutorch.so (torch::executor::native::custom_sdpa_out(executorch::runtime::KernelRuntimeContext&, executorch::runtime::etensor::Tensor const&, executorch::runtime::etensor::Tensor const&, executorch::runtime::etensor::Tensor const&, long, executorch::runtime::etensor::optionalexecutorch::runtime::etensor::Tensor const&, double, bool, executorch::runtime::etensor::optional, executorch::runtime::etensor::Tensor&)+900) (BuildId: c029051dea0ed0a950b3dfbe13e0abb308c8fffc)
10-31 18:37:39.951 8239 8239 F DEBUG : #8 pc 00000000001d7b08 /data/app/~~ImJJk3ALh5n5ShLD4F8Lrg==/com.example.executorchllamademo-MlcPHIKrzFBwL18FakDLYw==/lib/arm64/libexecutorch.so (torch::executor::native::sdpa_with_kv_cache_out(executorch::runtime::KernelRuntimeContext&, executorch::runtime::etensor::Tensor const&, executorch::runtime::etensor::Tensor const&, executorch::runtime::etensor::Tensor const&, executorch::runtime::etensor::Tensor&, executorch::runtime::etensor::Tensor&, long, long, executorch::runtime::etensor::optionalexecutorch::runtime::etensor::Tensor const&, double, bool, executorch::runtime::etensor::optional, executorch::runtime::etensor::Tensor&)+856) (BuildId: c029051dea0ed0a950b3dfbe13e0abb308c8fffc)
10-31 18:37:39.952 8239 8239 F DEBUG : #9 pc 00000000001e3314 /data/app/~~ImJJk3ALh5n5ShLD4F8Lrg==/com.example.executorchllamademo-MlcPHIKrzFBwL18FakDLYw==/lib/arm64/libexecutorch.so (void executorch::extension::kernel_util_internal::call_functor_with_args_from_stack<executorch::extension::kernel_util_internal::CompileTimeFunctionPointer<executorch::runtime::etensor::Tensor& (executorch::runtime::KernelRuntimeContext&, executorch::runtime::etensor::Tensor const&, executorch::runtime::etensor::Tensor const&, executorch::runtime::etensor::Tensor const&, executorch::runtime::etensor::Tensor&, executorch::runtime::etensor::Tensor&, long, long, executorch::runtime::etensor::optionalexecutorch::runtime::etensor::Tensor const&, double, bool, executorch::runtime::etensor::optional, executorch::runtime::etensor::Tensor&), &(torch::executor::native::sdpa_with_kv_cache_out(executorch::runtime::KernelRuntimeContext&, executorch::runtime::etensor::Tensor const&, executorch::runtime::etensor::Tensor const&, executorch::runtime::etensor::Tensor const&, executorch::runtime::etensor::Tensor&, executorch::runtime::etensor::Tensor&, long, long, executorch::runtime::etensor::optionalexecutorch::runtime::etensor::Tensor const&, double, bool, executorch::runtime::etensor::optional, executorch::runtime::etensor::Tensor&))>, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul, 11ul, executorch::runtime::etensor::Tensor const&, executorch::runtime::etensor::Tensor const&, executorch::runtime::etensor::Tensor const&, executorch::runtime::etensor::Tensor&, executorch::runtime::etensor::Tensor&, long, long, executorch::runtime::etensor::optionalexecutorch::runtime::etensor::Tensor const&, double, bool, executorch::runtime::etensor::optional, executorch::runtime::etensor::Tensor&>(executorch::runtime::KernelRuntimeContext&, executorch::runtime::EValue**, std::__ndk1::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul, 11ul>, executorch::extension::kernel_util_internal::typelist<executorch::runtime::etensor::Tensor const&, executorch::runtime::etensor::Tensor const&, executorch::runtime::etensor::Tensor const&, executorch::runtime::etensor::Tensor&, executorch::runtime::etensor::Tensor&, long, long, executorch::runtime::etensor::optionalexecutorch::runtime::etensor::Tensor const&, double, bool, executorch::runtime::etensor::optional, executorch::runtime::etensor::Tensor&>)+328) (BuildId: c029051dea0ed0a950b3dfbe13e0abb308c8fffc)
10-31 18:37:39.952 8239 8239 F DEBUG : #10 pc 0000000000bd223c /data/app/~~ImJJk3ALh5n5ShLD4F8Lrg==/com.example.executorchllamademo-MlcPHIKrzFBwL18FakDLYw==/lib/arm64/libexecutorch.so (executorch::runtime::Method::execute_instruction()+272) (BuildId: c029051dea0ed0a950b3dfbe13e0abb308c8fffc)
10-31 18:37:39.952 8239 8239 F DEBUG : #11 pc 0000000000bd2bf8 /data/app/~~ImJJk3ALh5n5ShLD4F8Lrg==/com.example.executorchllamademo-MlcPHIKrzFBwL18FakDLYw==/lib/arm64/libexecutorch.so (executorch::runtime::Method::execute()+136) (BuildId: c029051dea0ed0a950b3dfbe13e0abb308c8fffc)
10-31 18:37:39.952 8239 8239 F DEBUG : #12 pc 0000000000bd77e0 /data/app/~~ImJJk3ALh5n5ShLD4F8Lrg==/com.example.executorchllamademo-MlcPHIKrzFBwL18FakDLYw==/lib/arm64/libexecutorch.so (executorch::extension::Module::execute(std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator > const&, std::__ndk1::vector<executorch::runtime::EValue, std::__ndk1::allocatorexecutorch::runtime::EValue > const&)+396) (BuildId: c029051dea0ed0a950b3dfbe13e0abb308c8fffc)
10-31 18:37:39.952 8239 8239 F DEBUG : #13 pc 0000000000b730b8 /data/app/~~ImJJk3ALh5n5ShLD4F8Lrg==/com.example.executorchllamademo-MlcPHIKrzFBwL18FakDLYw==/lib/arm64/libexecutorch.so (example::LlavaImagePrefiller::prefill(executorch::extension::llm::Image&, long&)+780) (BuildId: c029051dea0ed0a950b3dfbe13e0abb308c8fffc)
10-31 18:37:39.952 8239 8239 F DEBUG : #14 pc 0000000000b70e30 /data/app/~~ImJJk3ALh5n5ShLD4F8Lrg==/com.example.executorchllamademo-MlcPHIKrzFBwL18FakDLYw==/lib/arm64/libexecutorch.so (example::LlavaRunner::prefill_images(std::__ndk1::vector<executorch::extension::llm::Image, std::__ndk1::allocatorexecutorch::extension::llm::Image >&, long&)+80) (BuildId: c029051dea0ed0a950b3dfbe13e0abb308c8fffc)
10-31 18:37:39.952 8239 8239 F DEBUG : #15 pc 00000000001fc524 /data/app/~~ImJJk3ALh5n5ShLD4F8Lrg==/com.example.executorchllamademo-MlcPHIKrzFBwL18FakDLYw==/lib/arm64/libexecutorch.so (executorch_jni::ExecuTorchLlamaJni::prefill_images(facebook::jni::alias_ref<_jintArray
>, int, int, int, long)+1044) (BuildId: c029051dea0ed0a950b3dfbe13e0abb308c8fffc)
10-31 18:37:39.952 8239 8239 F DEBUG : #16 pc 00000000001fc9ac /data/app/~~ImJJk3ALh5n5ShLD4F8Lrg==/com.example.executorchllamademo-MlcPHIKrzFBwL18FakDLYw==/lib/arm64/libexecutorch.so (facebook::jni::detail::MethodWrapper<facebook::jni::basic_strong_ref<_jlongArray*, facebook::jni::LocalReferenceAllocator> (executorch_jni::ExecuTorchLlamaJni::)(facebook::jni::alias_ref<_jintArray>, int, int, int, long), &(executorch_jni::ExecuTorchLlamaJni::prefill_images(facebook::jni::alias_ref<_jintArray*>, int, int, int, long)), executorch_jni::ExecuTorchLlamaJni, facebook::jni::basic_strong_ref<_jlongArray*, facebook::jni::LocalReferenceAllocator>, facebook::jni::alias_ref<_jintArray*>, int, int, int, long>::dispatch(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<executorch_jni::ExecuTorchLlamaJni, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::alias_ref<_jintArray*>&&, int&&, int&&, int&&, long&&)+124) (BuildId: c029051dea0ed0a950b3dfbe13e0abb308c8fffc)
10-31 18:37:39.952 8239 8239 F DEBUG : #17 pc 00000000001fc88c /data/app/~~ImJJk3ALh5n5ShLD4F8Lrg==/com.example.executorchllamademo-MlcPHIKrzFBwL18FakDLYw==/lib/arm64/libexecutorch.so (facebook::jni::detail::FunctionWrapper<facebook::jni::basic_strong_ref<_jlongArray*, facebook::jni::LocalReferenceAllocator> ()(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<executorch_jni::ExecuTorchLlamaJni, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject>, facebook::jni::alias_ref<_jintArray*>&&, int&&, int&&, int&&, long&&), facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<executorch_jni::ExecuTorchLlamaJni, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, facebook::jni::basic_strong_ref<_jlongArray*, facebook::jni::LocalReferenceAllocator>, facebook::jni::alias_ref<_jintArray*>, int, int, int, long>::call(_JNIEnv*, _jobject*, _jintArray*, int, int, int, long, facebook::jni::basic_strong_ref<_jlongArray*, facebook::jni::LocalReferenceAllocator> ()(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<executorch_jni::ExecuTorchLlamaJni, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject>, facebook::jni::alias_ref<_jintArray*>&&, int&&, int&&, int&&, long&&))+124) (BuildId: c029051dea0ed0a950b3dfbe13e0abb308c8fffc)
10-31 18:37:39.952 8239 8239 F DEBUG : #18 pc 0000000000384370 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+144) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #19 pc 000000000036db74 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #20 pc 0000000000359324 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+132) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #21 pc 0000000000353c88 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+448) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #22 pc 000000000076e264 /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp(art::interpreter::SwitchImplContext*)+12452) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #23 pc 00000000003869d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #24 pc 0000000000356fd8 /data/app/~~ImJJk3ALh5n5ShLD4F8Lrg==/com.example.executorchllamademo-MlcPHIKrzFBwL18FakDLYw==/base.apk (org.pytorch.executorch.LlamaModule.prefillImages+0)
10-31 18:37:39.952 8239 8239 F DEBUG : #25 pc 0000000000359650 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.4560577758463694485)+428) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #26 pc 000000000035ac9c /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+100) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #27 pc 0000000000353de0 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+792) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #28 pc 000000000076e264 /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp(art::interpreter::SwitchImplContext*)+12452) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #29 pc 00000000003869d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #30 pc 000000000000777c /data/app/~~ImJJk3ALh5n5ShLD4F8Lrg==/com.example.executorchllamademo-MlcPHIKrzFBwL18FakDLYw==/base.apk (com.example.executorchllamademo.MainActivity.lambda$showMediaPreview$17$com-example-executorchllamademo-MainActivity+0)
10-31 18:37:39.952 8239 8239 F DEBUG : #31 pc 0000000000359650 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.4560577758463694485)+428) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #32 pc 0000000000367a78 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4124) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #33 pc 000000000076e170 /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp(art::interpreter::SwitchImplContext*)+12208) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #34 pc 00000000003869d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #35 pc 0000000000006858 /data/app/~~ImJJk3ALh5n5ShLD4F8Lrg==/com.example.executorchllamademo-MlcPHIKrzFBwL18FakDLYw==/base.apk (com.example.executorchllamademo.MainActivity$$ExternalSyntheticLambda8.run+0)
10-31 18:37:39.952 8239 8239 F DEBUG : #36 pc 00000000003589dc /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+1932) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #37 pc 0000000000384498 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #38 pc 000000000215bcbc /memfd:jit-cache (deleted) (offset 0x2000000) (java.util.concurrent.ThreadPoolExecutor.runWorker+444)
10-31 18:37:39.952 8239 8239 F DEBUG : #39 pc 000000000215ba50 /memfd:jit-cache (deleted) (offset 0x2000000) (java.util.concurrent.ThreadPoolExecutor$Worker.run+128)
10-31 18:37:39.952 8239 8239 F DEBUG : #40 pc 0000000002004578 /memfd:jit-cache (deleted) (offset 0x2000000) (java.lang.Thread.run+136)
10-31 18:37:39.952 8239 8239 F DEBUG : #41 pc 000000000036db74 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #42 pc 0000000000359324 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+132) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #43 pc 0000000000944438 /apex/com.android.art/lib64/libart.so (_ZN3art9ArtMethod14InvokeInstanceILc86ETpTncJEEENS_6detail12ShortyTraitsIXT_EE4TypeEPNS_6ThreadENS_6ObjPtrINS_6mirror6ObjectEEEDpNS3_IXT0_EE4TypeE+60) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #44 pc 00000000006209f4 /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1344) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #45 pc 00000000006204a4 /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallbackWithUffdGc(void*)+8) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
10-31 18:37:39.952 8239 8239 F DEBUG : #46 pc 00000000000c3914 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208) (BuildId: edc1b601d9f8344c1eccd3d77a458f65)
10-31 18:37:39.952 8239 8239 F DEBUG : #47 pc 000000000005d084 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+68) (BuildId: edc1b601d9f8344c1eccd3d77a458f65)

@Vinaysukhesh98
Copy link

Hi do we have any solution for this issue

@muxi1998
Copy link

muxi1998 commented Jan 6, 2025

I'm encountering a similar issue with Llava while profiling an image. The model loads successfully but the app crashes after selecting an image. Does anyone have any suggestions to resolve this issue? I'm working on the main branch with pre-built library downloaded. Thank you in advance!

截圖 2025-01-06 下午1 43 39

@cmodi-meta
Copy link
Contributor

Thank you all for the comments and logs for this. I'll see if I can reproduce this on my side for debugging.

Since there looks to be related with resizing the image during the prefill stage, I'm curious if trying with another image (smaller or different dimensions) would behave better?

@muxi1998
Copy link

Hi @cmodi-meta, thank you for your response. While providing the exact 336x224 image resolves the resizing issue, a subsequent problem arises: Scudo ERROR: CHECK failed @ external/scudo/standalone/list.h:215 (Prev->Next) == (X) ((u64)op1=18410715280977166336, (u64)op2=72058060647296944). This ultimately leads to the application crashing. Has anyone else encountered and found a solution for this issue?

@cmodi-meta
Copy link
Contributor

@muxi1998 Glad that we identified it was related to the image size for the previous issue you shared. Just to be clear on that one, what it resolved with providing the exact image or did you need to provide a smaller image? If you needed to provide a smaller or resized image then would you be open to sharing the original and resized dimensions so we can repro on our side?

In regards to the new issue, this could be associated with memory. Can you share the RAM size of your device? Also can you test with this attached image just to ensure a baseline image?

Thanks!

Image

@muxi1998
Copy link

muxi1998 commented Jan 17, 2025

@cmodi-meta For the image size, I need to provide an exact 336×224 ratio image to prevent the app from crashing. If I use an image sized 336×225, the app crashes. However, I believe this issue is less critical compared to the second issue, which I’d like to prioritize and investigate first. Attached is a screenshot of the physical Android phone I’m currently using. Thank you so much for your assistance—I’m really excited to get this running successfully!

This is the screenshot phone the physical android device I tested
Image

And, this is the screenshot from the emulator on android studio

Image

Both of them will encounter the Scudo issue:
D Llava start prefill image
I Scudo ERROR: CHECK failed @ external/scudo/standalone/list.h:215 (Prev->Next) == (X) ((u64)op1=18410715280977166336, (u64)op2=72058129210187696)

By the way, the executorch.aar I used is built from the latest main branch.

Thanks~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: android Issues related to Android code, build, and execution triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
Status: Backlog/Lowpri
Development

No branches or pull requests

8 participants