-
Notifications
You must be signed in to change notification settings - Fork 24.1k
[DCP] set_model_state_dict
errors on compiled module with non-persistent buffer
#122792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Comments
Reopening this issue as the fix only correctly handle non_persistent buffers in eager mode, but there are still issues during for compiled. |
This was referenced May 27, 2024
antoinebrl
pushed a commit
to antoinebrl/pytorch
that referenced
this issue
May 27, 2024
…ytorch#125337) Summary: Fixes pytorch#122792 state_dict includes only persistent buffers, while named_buffers() would include non_persistent buffers. Pull Request resolved: pytorch#125337 Approved by: https://github.com/awgu ghstack dependencies: pytorch#125333, pytorch#125501, pytorch#125334, pytorch#125335, pytorch#125336
huydhn
pushed a commit
that referenced
this issue
May 27, 2024
…125337) (#127219) * [DSD] Fix to remove non_persistent buffer in distributed state dict (#125337) Summary: Fixes #122792 state_dict includes only persistent buffers, while named_buffers() would include non_persistent buffers. Pull Request resolved: #125337 Approved by: https://github.com/awgu ghstack dependencies: #125333, #125501, #125334, #125335, #125336 * lintrunner * lint --------- Co-authored-by: Chien-Chin Huang <chienchin@fb.com> Co-authored-by: Andrey Talman <atalman@fb.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
set_model_state_dict
calls into_load_model_state_dict
, which iterates overnamed_buffers()
. For a compiled module,fqns
andfqns_with_prefix
always mismatch, so_load_model_state_dict
will try to reassign from the FQN without prefix to the one with prefix. However, this does not account for non-persistent buffers not existing in the state dict.One solution could be just to continue
if fqn not in state_dict
.cc @LucasLLC
The text was updated successfully, but these errors were encountered: