-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Baby-llama.cpp report bus error #4830
Comments
I have encountered the same issue while trying to run this example. I am trying to implement something similar to what is described in this issue. If no one else is on it, I'd like to try finding and implementing a fix. |
After further investigation, I've pinpointed the issue within the Here's a breakdown of the call sequence leading to the exception:
size_t h = ggml_hash(key) % hash_set.size; it seems that hash_set.size is zero, which results in a division by zero, leading to SIGFPE (Arithmetic exception). So it appears that the division by zero in ggml_hash_find is the main cause. I'm currently exploring why gf->visited_hash_table's size is zero at this point in the execution and how we can ensure it's properly initialized before reaching this critical operation. Any further suggestions would be greatly appreciated. |
Okay I was able to fix the issue by just changing the lines that contain gf = {} in the main function to struct ggml_cgraph * gf = NULL;
gf = ggml_new_graph_custom(ctx0, LLAMA_TRAIN_MAX_NODES, true); I am not sure this is the best way to go about it, but it works for now, any suggestions would be appreciated. I can also try to push the fix. |
@NawafAlansari That looks correct. When the baby-llama example was created, graphs had a fixed size and could be allocated in the stack, but that was changed a while ago and now graphs need to be allocated in a |
@slaren I just made a PR with a fix for the example. |
* Fixed the baby-llama issue (see issue #4830) * minor : fix whitespaces --------- Co-authored-by: Georgi Gerganov <[email protected]>
* Fixed the baby-llama issue (see issue ggerganov#4830) * minor : fix whitespaces --------- Co-authored-by: Georgi Gerganov <[email protected]>
* Fixed the baby-llama issue (see issue ggerganov#4830) * minor : fix whitespaces --------- Co-authored-by: Georgi Gerganov <[email protected]>
* Fixed the baby-llama issue (see issue ggerganov#4830) * minor : fix whitespaces --------- Co-authored-by: Georgi Gerganov <[email protected]>
This issue was closed because it has been inactive for 14 days since being marked as stale. |
System: MacOS Ventura 13.2.1
CPU: M2 Pro
Reproduction process
cd llama.cpp
make
./baby-llama
And then, the terminal will print:
And similar error on my linux server
System: Ubuntu 22.04.2 LTS
Architecture: x86_64
CPU(s): 128
Model name: Intel(R) Xeon(R) CPU @ 2.90GHz
Under the same steps, the terminal will print the following error:
The text was updated successfully, but these errors were encountered: