Repository navigation
Conversation
Serialize INT8 row scales and packed 4-bit quantization metadata. Restore fresh or prequantized embeddings through native state_dict loading while preserving parameter identity for copy-based loads. Signed-off-by: Afloat <ShuffleMonkey@163.com>
Cover fresh and meta embeddings with native assign=True restores. Signed-off-by: Afloat <ShuffleMonkey@163.com>
Signed-off-by: Afloat <ShuffleMonkey@163.com>
Signed-off-by: Afloat <ShuffleMonkey@163.com>
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.
Problem
Embedding8bitandEmbedding4bitcurrently raiseNotImplementedErrorfromstate_dict(). A model containing these frozen quantized embeddings therefore cannot use the normal model/optimizer checkpoint workflow, even when only its downstream layers are trainable.Change
QuantStatemetadata.assign=True, including materializing a meta-initialized embedding.Validation
Exact production commit:
68fef90cd796dc324d12abb5cbaa3fa7166fa0ae.44 new native CPU cases cover INT8/FP4/NF4, both partial and block-aligned row widths, copy/assign modes, fresh and prequantized destinations, FP16/BF16 packed storage, and meta initialization. The model tests train a downstream layer, save model and optimizer states to disk, restore both, and compare the next two SGD steps exactly.
Original source: all 44 new cases fail. Patched source: all 44 pass. The existing embedding/Int8Params selection passes 64 tests with one existing unsupported-CPU skip. Ruff and formatting pass for all changed Python files.
Native validation: https://github.com/Afloat16/bitsandbytes/actions/runs/43405757953
The run compiles the repository's AVX2 CPU extension and uses PyTorch 2.14.0+cpu. The validation concerns checkpoint fidelity and resumed execution; it does not measure GPU throughput.