[FSDP] Fix param name prefixes for ignored modules#79955
[FSDP] Fix param name prefixes for ignored modules#79955awgu wants to merge 1 commit intopytorch:masterfrom
Conversation
🔗 Helpful links
✅ No Failures (0 Pending)As of commit ec35a3b (more details on the Dr. CI page): Expand to see more💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
|
@awgu has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@pytorchbot merge |
|
@pytorchbot successfully started a merge job. Check the current status here |
|
@awgu your PR has been successfully merged. |
|
Hey @awgu. |
Summary: For ignored modules' parameters, we should also clean their parameter names since they will have the FSDP-specific prefixes. This change only affects the prefixed parameter name keys in `full_optim_state_dict()` (i.e. optim state dict saving). Not having this change does not actually violate the correctness of the optim state dict save-load flow because it only requires that the keys are unique and internally consistent. Either way, this PR explicitly adds the specification now that the parameter keys in the optim state dict should match the keys of full model state dict. Pull Request resolved: #79955 Approved by: https://github.com/rohan-varma Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/0b0e65516d88b6ea5ac06598dc8247afe3c21d20 Reviewed By: rohan-varma Differential Revision: D37320671 Pulled By: awgu fbshipit-source-id: 576cf28f7f744fcb75f79af1fae7a3fd2c567d89
For ignored modules' parameters, we should also clean their parameter names since they will have the FSDP-specific prefixes. This change only affects the prefixed parameter name keys in `full_optim_state_dict()` (i.e. optim state dict saving). Not having this change does not actually violate the correctness of the optim state dict save-load flow because it only requires that the keys are unique and internally consistent. Either way, this PR explicitly adds the specification now that the parameter keys in the optim state dict should match the keys of full model state dict. Pull Request resolved: pytorch#79955 Approved by: https://github.com/rohan-varma
For ignored modules' parameters, we should also clean their parameter names since they will have the FSDP-specific prefixes. This change only affects the prefixed parameter name keys in `full_optim_state_dict()` (i.e. optim state dict saving). Not having this change does not actually violate the correctness of the optim state dict save-load flow because it only requires that the keys are unique and internally consistent. Either way, this PR explicitly adds the specification now that the parameter keys in the optim state dict should match the keys of full model state dict. Pull Request resolved: pytorch#79955 Approved by: https://github.com/rohan-varma
For ignored modules' parameters, we should also clean their parameter names since they will have the FSDP-specific prefixes.
This change only affects the prefixed parameter name keys in
full_optim_state_dict()(i.e. optim state dict saving). Not having this change does not actually violate the correctness of the optim state dict save-load flow because it only requires that the keys are unique and internally consistent.Either way, this PR explicitly adds the specification now that the parameter keys in the optim state dict should match the keys of full model state dict.