-
Notifications
You must be signed in to change notification settings - Fork 31.3k
Fix: Falcon tie_word_embeddings in GGUF #35715
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
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
But I remember BTW, if the issue about |
|
|
Isotr0py
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for fixing!
SunMarc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ! Let's do that for falcon but if more issues starts to appear, let's modify the tests slightly to not take into account the device of the tensors
* fix falcon tie_word_embeddings * fix style
* fix falcon tie_word_embeddings * fix style
What does this PR do?
In the
modeling_gguf_pytorch_utils.pyfile, the value oftie_word_embeddingsis determined by the presence (or absence) of the tensoroutput.weightin the GGUF file. While this approach is generally a good indicator, the Falcon architecture is an exception to the rule as you can see here : https://huggingface.co/tiiuae/falcon-7b/tree/main?show_file_info=model-00002-of-00002.safetensors (hf format) and here https://huggingface.co/tensorblock/falcon-7b-GGUF/tree/main?show_file_info=falcon-7b-Q2_K.gguf (gguf format)In Falcon,
word_embeddingsare tied to thelm_headweights. Despite this,output.weightis still present in the GGUF file, andlm_headis included in the Hugging Face model format. To handle this edge case, I added an exception array for such architectures.This issue was causing a subtle error related to parameters not being on the same device, which was only discoverable in multi-GPU settings.
Who can review ?
@SunMarc @Isotr0py