Repository navigation
Fix loading sharded GGUF checkpoints - #50653
Open
not-heavychevy wants to merge 1 commit into
Open
not-heavychevy wants to merge 1 commit into
not-heavychevy wants to merge 1 commit into
Conversation
Contributor
|
Thank you for your contribution 🤗! CI Security Gate — waiting for maintainer approvalCI is approved automatically only for authors who already have a contribution merged in this repository. A maintainer will review this PR and approve CI to run on it. |
Contributor
|
[For maintainers] Suggested jobs to run (before merge) run-slow: ggml |
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.
What does this PR do?
Fixes #32266.
Passing the first shard as
gguf_filecurrently loads only that file. Weights stored in later shards can be reported missing and reinitialized. Configuration inference can also missoutput.weightand incorrectly tie the embeddings.This change resolves and validates the full shard set from the first filename. Configuration inference uses metadata from the first shard and tensor names from all shards. Both the legacy loader and the GGUF quantizer load weights from the complete set, using each file's own tensor offsets. Tokenizer loading can still read metadata from the first shard alone.
Validation
a6f5c8676band pass with the fix. They check configuration, missing and unexpected keys, and exact parameter and logit equality against single-file controls.gguf==0.10.0andgguf==0.19.0. Each run passed the two regressions andGgufDequantizeTest(3 tests and 17 subtests).pad_token_id=Noneoverride for these fixtures.fix-repopassed 18/18 checks. The CI quality and repository consistency profiles passed 7/7 and 20/20 checks, respectively, after targeted reruns. The combined check with Torch reports atywarning fortorch.distributed.get_rankthat also reproduces on cleanmain.