fix: skip None buffers in AutoTP Loading.load_buffer (checkpoint load with nn.InstanceNorm1d) - #8603
Open
SIDDARTHAREDDY8 wants to merge 1 commit into
Open
SIDDARTHAREDDY8 wants to merge 1 commit into
SIDDARTHAREDDY8 wants to merge 1 commit into
Conversation
… with nn.InstanceNorm1d) Signed-off-by: SIDDARTHA REDDY <75976672+SIDDARTHAREDDY8@users.noreply.github.com>
SIDDARTHAREDDY8
requested review from
hwchen2017 and
loadams
as code owners
September 20, 2026 03:18
SIDDARTHAREDDY8
force-pushed
the
bhai-blitz-8-deepspeed-1
branch
from
September 20, 2026 13:02
ef5ffb9 to
b832b6d
Compare
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.
Fixes #8514.
Summary
Loading a checkpoint via
replace_module/AutoTPinto a model containingnn.InstanceNorm1draisedAttributeError: 'NoneType' object has no attribute 'data'inLoading.load_buffer(
deepspeed/module_inject/auto_tp.py:153). InstanceNorm's running-stat buffers areNoneuntil firstuse, so
module._buffers[name].data.is_metablows up even though there is nothing to load for them.The fix skips
Nonebuffers in the loop, matching thecheckpoint=Nonewalk behavior.Test notes
AttributeErrorfrom the issue on master'sload_bufferwith annn.InstanceNorm1dmodule and a saved state dict; post-fix the walk completes and the
Nonebuffers are preserved asNone.nn.BatchNorm1d) still load checkpoint valuescorrectly and that the meta-tensor materialization path is unchanged.
deepspeedpackage import requires compiled ops, so the check ran the exact shipped function body(AST-extracted from the patched file) under torch 2.14.0+cpu. No GPU available here.