Skip to content

Bug: Some "code" models invoke undefined behavior at load time after #6745 #7592

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

Closed
cebtenzzre opened this issue May 28, 2024 · 1 comment · Fixed by #7644
Closed

Bug: Some "code" models invoke undefined behavior at load time after #6745 #7592

cebtenzzre opened this issue May 28, 2024 · 1 comment · Fixed by #7644
Labels
bug-unconfirmed high severity Used to report high severity bugs in llama.cpp (Malfunctioning hinder important workflow)

Comments

@cebtenzzre
Copy link
Collaborator

cebtenzzre commented May 28, 2024

What happened?

Steps to reproduce:

$ build/bin/main -m mistral-7b-code-16k-qlora.Q4_K_M.gguf -ngl 99 -n 0 -p ''
llm_load_print_meta: BOS token        = 1 '<s>'
llm_load_print_meta: EOS token        = 2 '</s>'
llm_load_print_meta: UNK token        = 0 '<unk>'
llm_load_print_meta: PAD token        = 0 '<unk>'
llm_load_print_meta: LF token         = 13 '<0x0A>'
/usr/include/c++/14.1.1/bits/stl_vector.h:1149: std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = llama_vocab::token_data; _Alloc = std::allocator<llama_vocab::token_data>; const_reference = const llama_vocab::token_data&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
[1]    40137 IOT instruction (core dumped)  build/bin/main -m mistral-7b-code-16k-qlora.Q4_K_M.gguf

When printing the PRE token it crashes, because the token ID is 32007 (the default for "code" models) but n_vocab is only 32000. Before #6745, the models loads successfully.

Name and Version

$ build/bin/main --version
version: 2702 (b97bc3966)
built with gcc (GCC) 14.1.1 20240522 for x86_64-pc-linux-gnu

What operating system are you seeing the problem on?

No response

Relevant log output

No response

@cebtenzzre cebtenzzre added bug-unconfirmed high severity Used to report high severity bugs in llama.cpp (Malfunctioning hinder important workflow) labels May 28, 2024
@cebtenzzre
Copy link
Collaborator Author

cc @pcuenca

@cebtenzzre cebtenzzre changed the title Bug: Some models invoke undefined behavior at load time after #6745 Bug: Some "code" models invoke undefined behavior at load time after #6745 May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-unconfirmed high severity Used to report high severity bugs in llama.cpp (Malfunctioning hinder important workflow)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant