Repository navigation
Conversation
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.
Summary
restore_packed_modulerebuilt each packed layer on the meta device with the kernel's default fp16 bias placeholder. Quantized layers keep their bias at the source model dtype (bf16/fp32 on Qwen2/2.5, OPT, Bloom), so the resume schema check compared the rebuilt fp16 bias against the BF16 bundle tensor and aborted withcheckpoint tensor schema differs: <module>.What Changed
packed_module_confignow records the real bias dtype (bias_dtype) whenever the packed module owns a bias tensor.restore_packed_moduleconsumes that recorded dtype and casts the rebuilt meta bias (andbias_dtypeattribute) to the checkpoint width, so the tensor schema matches the bundle.gptq_checkpoint.pyis unchanged: a genuinely different bundle dtype still raisesCheckpointError.Tests
The new test drives the real
QuantizationCheckpointAdapter.capture()/restore()path with a syntheticTorchLinearbundle whose bias is bf16/fp32; both cases fail on the parent commit withCheckpointError: checkpoint tensor schema differs: projand pass with the fix. The negative case rewrites the bundle bias to fp32 while the recorded schema says bf16 and assertsCheckpointErroris still raised.Model Support / Module Plan
N/A — no new model types or registry entries.
Fixes #4324