-
Notifications
You must be signed in to change notification settings - Fork 231
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
GGUF: the file quantization type is not the GGMLQuantizationType. #794
Comments
Yes. What is the precise issue in this repo? |
And some tests incorrectly use the |
maybe cc @ngxson (not sure) |
Yes you’re correct @snowyu . general.file_type is the quantization scheme (i.e MOSTLY_*). I will push a fix later (sorry I’m quite busy atm) @julien-c FYI, it’s because quantized model usually use mixed types. For example norm layer can always stay at f32 or f16, while other tensors can be Qk. This improves model performance with a little cost of space. Hence the word « mostly » used in type name |
@snowyu thanks for your comment !
indeed, we should create enum
Since this package is for parsing metadata (not a framework like llama.cpp), we should not guess anything. If the field exists, it exists. Otherwise, it does not and we do not present anything that did not exist in the file itself.
Yep, after we add The changes should be pretty straightforward. Please feel free to open a PR and tag me 🤗 |
@mishig25 that's it for #794 --------- Co-authored-by: Xuan Son Nguyen <[email protected]>
There are two kinds of quantization in llama.cpp, don't confuse them:
ggml_type
): for tensor https://github.com/ggerganov/llama.cpp/blob/7a221b672e49dfae459b1af27210ba3f2b5419b6/ggml/include/ggml.h#L354general.file_type
): for file https://github.com/ggerganov/llama.cpp/blob/7a221b672e49dfae459b1af27210ba3f2b5419b6/include/llama.h#L131If "general.file_type" is not configured, the following algorithm is used to guess the quantization type of the file:
https://github.com/ggerganov/llama.cpp/blob/7a221b672e49dfae459b1af27210ba3f2b5419b6/src/llama.cpp#L3751C1-L3802C65
The text was updated successfully, but these errors were encountered: