forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FSDP] Clean missing and unexpected keys (pytorch#120600)
Currently, when loading w/strict=False or w/strict=True and looking at error message, FQNs are garbled w/FSDP details such as "_fsdp_wrapped_module". This makes it tricky for upstream applications to validate the expected set of keys are missing / unexpected (for example with PEFT where state_dict is loaded non-strict), and makes error message more complicated w/FSDP details. This PR cleans those prefixes by using `clean_tensor_name` in FSDP's existing post load_state_dict hooks. Currently, only full_state_dict impl is tested, can test the rest of the impls as follow up work. Differential Revision: [D54182472](https://our.internmc.facebook.com/intern/diff/D54182472/) Pull Request resolved: pytorch#120600 Approved by: https://github.com/XilunWu, https://github.com/fegin
- Loading branch information
1 parent
b2a318d
commit 9db6a84
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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