Repository navigation
Conversation
Contributor
|
Validated exact head
That gives coverage across the Conv1D/parallel CodeGen path, Falcon's packed attention projection, and the Qwen2 MoE/shared-expert path. I did not find a dtype regression in the added architecture controls. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1911.
process_weightsupcasts non-float32 floating tensors to float32 for the folds and restores the recorded dtypes afterwards. Biases created during processing (q/k/v biases from LN folding, the MLP input and gate biases,b_Ofromfold_value_biases) were not in that record, so they stayed float32, and the next forward of a bf16/fp16 bridge afterenable_compatibility_mode()failed withself and mat2 must have the same dtype. On MPS the process aborts.Each created key now takes the original dtype of its
.weightsibling before the existing downcast runs. Keys that were already in the state dict, fp32 models and the float32 arithmetic during the folds are unchanged.Besides GPT-Neo, GPT-J, Qwen2 and StableLM from the issue, this fixes GLM, GLM-4, Qwen2.5-VL, Falcon, CodeGen, Qwen2-MoE and Seed-OSS, which fail the same way on tiny
from_configmodels in bf16 and fp16.Type of change
Checklist: