-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Can't Quantize gguf files: zsh: illegal hardware instruction on M1 MacBook Pro #3983
Comments
This started occurring both on my M1 Pro and M2 Ultra after updating to Sonoma. I tried to debug this, but adding prints in the quantization functions makes the issue disappear. If anybody has any ideas how to fix this, please share |
Thanks, @ggerganov, I was beginning to think I was the only one experiencing this. It's nice to know that you are aware of it, and have been working on finding a solution. And, thank you for the temporary workaround, I'll use this for now. |
@ggerganov , running LLDB on the code seems to be able to catch a little more info about the crash:
whereas if I do the same thing with the '-O2' flag instead then I get:
(So the code is able to make it out of the workers loop in O2 but dies within that loop in O3). |
Some variable info at the crash site:
Also, it got lost when posting here, but in terminal the first "x" in line 1277 is underlined by lldb when it gives the EXC_BAD_INSTRUCTION error |
Another potentially relevant thing. When building with -O2 then:
Whereas when building with -O3 then:
So the O3 optimization level is doing some kind of unrolling or other replication that is causing the problematic line to show up in 3 different places rather than 1. |
A PR that allows me to run quantization again while keeping -O3 quantization: #4052 |
As mentioned in #4052 I can reproduce this with clang but not with homebrew gcc. Oddly enough, it seems to be a linker issue. Here's the code before linking:
And here's the code after linking:
Note how this line:
Has turned into this:
This is my linker:
|
Fixed in #4052 |
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Expected Behavior
Successfully quantize and run large language models that I convert to gguf on M1 MacBook Pro
Current Behavior
Quantization halts due to "zsh: illegal hardware instruction".
Environment and Context
OS: Mac OS Sonoma
System: 2020 M1 MacBook Pro 16GB RAM
Xcode: Version 15.0.1 (15A507)
Apple clang version 15.0.0 (clang-1500.0.40.1)
Make 3.81 (GNU)
Python 3.11.5
Homebrew 4.1.19
Anaconda3 (23.10.0)
Failure Information (for bugs)
zsh: illegal hardware instruction
Steps to Reproduce
Please provide detailed steps for reproducing the issue. We are not sitting in front of your screen, so the more detail the better.
Failure Logs
The text was updated successfully, but these errors were encountered: