mlc-ai / mlc-llm

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

[Bug] ByT5 not supported #981

Open acalatrava opened 1 year ago

acalatrava commented 1 year ago

🐛 Bug

While playing with PY007/ByteLlama-320M-preview which uses ByT5 tokenizer (AKA no tokenizer, it just operates on bytes) I get the following error:

Stack trace:
  [bt] (0) 1   libmlc_llm.dylib                    0x0000000103ce7e14 tvm::runtime::detail::LogFatal::Entry::Finalize() + 68
  [bt] (1) 2   libmlc_llm.dylib                    0x0000000103ce7dd0 tvm::runtime::detail::LogFatal::Entry::Finalize() + 0
  [bt] (2) 3   libmlc_llm.dylib                    0x0000000103ce6d6c std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>::~vector[abi:v160006]() + 0
  [bt] (3) 4   libmlc_llm.dylib                    0x0000000103cfdfa8 mlc::llm::LLMChat::Reload(tvm::runtime::TVMArgValue, tvm::runtime::String, tvm::runtime::String) + 9376
  [bt] (4) 5   libmlc_llm.dylib                    0x0000000103cfb7c8 mlc::llm::LLMChatModule::GetFunction(tvm::runtime::String const&, tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::'lambda'(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const + 488
  [bt] (5) 6   libmlc_llm.dylib                    0x0000000103cfb5d4 tvm::runtime::PackedFuncObj::Extractor<tvm::runtime::PackedFuncSubObj<mlc::llm::LLMChatModule::GetFunction(tvm::runtime::String const&, tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::'lambda'(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)>>::Call(tvm::runtime::PackedFuncObj const*, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) + 40
  [bt] (6) 7   mlc_chat_cli                        0x0000000102dd0894 ChatModule::Reload(ModelPaths const&) + 644
  [bt] (7) 8   mlc_chat_cli                        0x0000000102dcfd78 Chat(ChatModule*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, int) + 92
  [bt] (8) 9   mlc_chat_cli                        0x0000000102dd164c main + 1012

To Reproduce

Steps to reproduce the behavior:

  1. Try to use any ByT5 tokenizer

Expected behavior

Support for ByT5. I guess that adding ByT5 tokenizer should be easy since, in the end, is to remove the tokenizer, but I'm not sure about it.

Environment

Additional context

tqchen commented 11 months ago

This seems to be something that can be contributed to tokenizer cpp