Repository navigation
test(checkpoint): guard empty buffers against save-time dedup - #5539
Merged
Merged
Conversation
#5126 keys zero-element buffers by name because every empty tensor reports storage pointer 0, but nothing pinned that behaviour: removing the branch collapses `empty_left`/`empty_right` into a single entry and drops a key a kernel may require (QQQ `s_group` when `group_size == in_features`). Add the regression beside the existing shared-storage dedup tests. Red (with the `numel() == 0` branch removed): 1 failed. Green: 7 passed.
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
Every zero-element tensor reports storage pointer 0, so the save-time dedup in
get_state_dict_for_savecollapsed all empty buffers into one key and droppedthe rest. A kernel may require such a key to be present (QQQ keeps an empty
s_groupwhengroup_size == in_features), which then fails on reload withMissing required quantized weights.The name-keyed branch that fixes this is in
main, but nothing pins it.What Changed
test_empty_buffers_are_not_collapsed_as_shared_storagebeside theexisting shared-storage dedup tests: two empty buffers must both survive
get_state_dict_for_save.Refs #5126.
Tests