Skip to content

Android App Inference Error #6284

@j0h0k0i0m

Description

@j0h0k0i0m

model : Llama 3.2 1B (without any quantization)
I ran the app, loaded the model, and entered the input, but the following error appears in the middle of the output.

2024-10-16 17:11:17.782 17178-17576 utorchllamademo         com.example.executorchllamademo      A  java_vm_ext.cc:591] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal continuation byte 0
                                                                                                    java_vm_ext.cc:591]     string: '?'
                                                                                                    java_vm_ext.cc:591]     input: '0xec 0x8a'
                                                                                                    java_vm_ext.cc:591]     in call to NewStringUTF
                                                                                                    java_vm_ext.cc:591]     from int org.pytorch.executorch.LlamaModule.generate(int[], int, int, int, java.lang.String, int, org.pytorch.executorch.LlamaCallback, boolean)
2024-10-16 17:11:17.876 17178-17576 utorchllamademo         com.example.executorchllamademo      A  runtime.cc:691] Runtime aborting...
                                                                                                    runtime.cc:691] Dumping all threads without mutator lock held
                                                                                                    runtime.cc:691] All threads:
                                                                                                    runtime.cc:691] DALVIK THREADS (27):
                                                                                                    runtime.cc:691] "main" prio=10 tid=1 Native
                                                                                                    runtime.cc:691]   | group="" sCount=1 ucsCount=0 flags=1 obj=0x737f0ef8 self=0xb400007b1ff226f0
                                                                                                    runtime.cc:691]   | sysTid=17178 nice=-10 cgrp=top-app sched=0/0 handle=0x7d5fa84500
                                                                                                    runtime.cc:691]   | state=S schedstat=( 4937625082 302758513 5009 ) utm=434 stm=59 core=7 HZ=100
                                                                                                    runtime.cc:691]   | stack=0x7ff1afd000-0x7ff1aff000 stackSize=8188KB
                                                                                                    runtime.cc:691]   | held mutexes=
                                                                                                    runtime.cc:691]   native: #00 pc 000afe4c  /apex/com.android.runtime/lib64/bionic/libc.so (__epoll_pwait+12) (BuildId: edc1b601d9f8344c1eccd3d77a458f65)
                                                                                                    runtime.cc:691]   native: #01 pc 0001874c  /system/lib64/libutils.so (android::Looper::pollInner+192) (BuildId: a0e0ad47138267db6c479fc556e32d00)
                                                                                                    runtime.cc:691]   native: #02 pc 00018628  /system/lib64/libutils.so (android::Looper::pollOnce+124) (BuildId: a0e0ad47138267db6c479fc556e32d00)
                                                                                                    runtime.cc:691]   native: #03 pc 0019096c  /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce+48) (BuildId: 983411144db0ac3990d089da4be49137)
                                                                                                    runtime.cc:691]   native: #04 pc 02150ea0  /memfd:jit-cache (deleted) (offset 2000000) (art_jni_trampoline+144)
                                                                                                    runtime.cc:691]   native: #05 pc 02109844  /memfd:jit-cache (deleted) (offset 2000000) (android.os.MessageQueue.next+244)
                                                                                                    runtime.cc:691]   native: #06 pc 0217ce38  /memfd:jit-cache (deleted) (offset 2000000) (android.os.Looper.loopOnce+168)
                                                                                                    runtime.cc:691]   native: #07 pc 0033aa80  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
                                                                                                    runtime.cc:691]   native: #08 pc 00510b0c  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>+2364) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
                                                                                                    runtime.cc:691]   native: #09 pc 00490800  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>+1892) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
                                                                                                    runtime.cc:691]   native: #10 pc 003539d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
                                                                                                    runtime.cc:691]   native: #11 pc 00240f40  /system/framework/framework.jar (android.os.Looper.loop)
                                                                                                    runtime.cc:691]   native: #12 pc 0036daec  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute +232) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
                                                                                                    runtime.cc:691]   native: #13 pc 00511654  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>+5252) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
                                                                                                    runtime.cc:691]   native: #14 pc 00490800  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>+1892) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
                                                                                                    runtime.cc:691]   native: #15 pc 003539d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
                                                                                                    runtime.cc:691]   native: #16 pc 001d2edc  /system/framework/framework.jar (android.app.ActivityThread.main)
                                                                                                    runtime.cc:691]   native: #17 pc 0036daec  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute +232) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
                                                                                                    runtime.cc:691]   native: #18 pc 0036d3e4  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+964) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
                                                                                                    runtime.cc:691]   native: #19 pc 00351368  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
                                                                                                    runtime.cc:691]   native: #20 pc 0033aa80  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
                                                                                                    runtime.cc:691]   native: #21 pc 0037bf18  /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<8>+1556) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)

It seems that the issue is occurring because the input language is Korean. Could you advise which part must be modified to resolve this error? I have confirmed no issues when the input language is English.

### Tasks

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: androidIssues related to Android code, build, and executiontriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions