mlc-ai / mlc-llm

Universal LLM Deployment Engine with ML Compilation
https://llm.mlc.ai/
Apache License 2.0
19.09k stars 1.56k forks source link

[Bug] error: TVM runtime cannot find vm_load_executable when run MLCChat on MyMac(Designed for iPad) for codeLlama #1266

Closed ruiba168 closed 11 months ago

ruiba168 commented 11 months ago

🐛 Bug

Try to run MLC LLM on an iphone, with codeLlama, Got following error: Check failed: (fload_exec.defined()) is false: TVM runtime cannot find vm_load_executable

It works well for Llama 2.

To Reproduce

Steps to reproduce the behavior:

  1. compile codeLlama with command: python3 -m mlc_llm.build --model codellama_CodeLlama-7b-hf --target iphone --quantization q4f16_1
  2. clean everything under the ios/build
  3. run ./prepare_libs.sh
  4. change the content in ./prepare_params.sh, add codellama_CodeLlama-7b-hf-q4f16_1 in builtin_list section
  5. run ./prepare_params.sh
  6. add codellama_CodeLlama-7b-hf-q4f16_1 in app-config.json in MLCChat app.
  7. run MLCChat app and will get following error.

libc++abi: terminating due to uncaught exception of type tvm::runtime::InternalError: [15:12:48] /Users/I514295/work/project/llm/mlc-llm/cpp/llm_chat.cc:157: InternalError: Check failed: (fload_exec.defined()) is false: TVM runtime cannot find vm_load_executable Stack trace: [bt] (0) 1 ODataML 0x0000000104bc3244 tvm::runtime::detail::LogFatal::Entry::Finalize() + 68 [bt] (1) 2 ODataML 0x0000000104bc3200 tvm::runtime::detail::LogFatal::Entry::Finalize() + 0 [bt] (2) 3 ODataML 0x0000000104bc2274 __clang_call_terminate + 0 [bt] (3) 4 ODataML 0x0000000104bd9c50 mlc::llm::LLMChat::Reload(tvm::runtime::TVMArgValue, tvm::runtime::String, tvm::runtime::String) + 8104 [bt] (4) 5 ODataML 0x0000000104bd7a00 mlc::llm::LLMChatModule::GetFunction(tvm::runtime::String const&, tvm::runtime::ObjectPtr const&)::'lambda'(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue)::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue) const + 680 [bt] (5) 6 ODataML 0x0000000104bd774c tvm::runtime::PackedFuncObj::Extractor<tvm::runtime::PackedFuncSubObj<mlc::llm::LLMChatModule::GetFunction(tvm::runtime::String const&, tvm::runtime::ObjectPtr const&)::'lambda'(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue)>>::Call(tvm::runtime::PackedFuncObj const, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) + 40 [bt] (6) 7 ODataML 0x0000000104ba8334 -[ChatModule reload:modelPath:appConfigJson:] + 520 [bt] (7) 8 ODataML 0x0000000104b8673c $s7ODataML9ChatStateC010mainReloadC033_6907CD1CE42C658DF343ACFA85A59945LL7localID8modelLib0O4Path16estimatedVRAMReq11displayNameySSS2SSiSStFyycfU + 904 [bt] (8) 9 ODataML 0x0000000104bad318 $sIeg_ytIegr_TRTA + 20

Expected behavior

Environment

Additional context

ruiba168 commented 11 months ago

Found renaming the app's identity id will fix the issue.

junrushao commented 11 months ago

Interesting! What is the app's identity id, and why is this causing problems? I've seen a few similar reports and think it will be helpful to the other developers

omkar806 commented 7 months ago

hi I am facing this same issue for running gemma 2b on my mac ? how exactly can change the app's identity ID ? if there are any steps I need to follow ? Also what should be the changed ID ? to run the app successfully ?