Skip to content

Conversation

@liangel-02
Copy link
Contributor

@liangel-02 liangel-02 commented Dec 5, 2025

previously state_dict wasn't being reset after items were processed

tests

all unit tests pass, E2E testing with torchao eval scripts also pass

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes a bug in the torchao safetensors loading implementation where the state_dict was not being reset for each file in a sharded checkpoint. The added initialization ensures that each file is processed independently, preventing incorrect weight accumulation. I've also pointed out a small follow-up cleanup to remove a now-redundant variable initialization, which will improve maintainability.

Signed-off-by: Angel Li <liangel@meta.com>
@liangel-02 liangel-02 marked this pull request as ready for review December 5, 2025 20:22
@liangel-02 liangel-02 requested a review from 22quinn as a code owner December 5, 2025 20:22
@liangel-02
Copy link
Contributor Author

cc @mgoin can you pls take a look, thanks!

@jerryzh168
Copy link
Contributor

Hi @mgoin can you take a look / stamp

@DarkLight1337 DarkLight1337 added the ready ONLY add when PR is ready to merge/full CI is needed label Dec 6, 2025
@DarkLight1337 DarkLight1337 requested a review from mgoin December 6, 2025 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants