You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow passing in additional params to be ignored in the DDP wrapper (#2103)
Summary:
Pull Request resolved: #2103
# What
Add an option to allow users to pass in additional params to be ignored in DDP.
# Why
Currently the wrapper calls `DistributedDataParallel._set_params_and_buffers_to_ignore_for_model` to ignore all sharded params in the embedding modules.
However, if users want to call `DistributedDataParallel._set_params_and_buffers_to_ignore_for_model` before torchrec, their params to-be-ignored will be overwriten by torchrec's call. Discussion: https://fb.workplace.com/groups/319878845696681/permalink/1199477041070186/
Why users want to call `_set_params_and_buffers_to_ignore_for_model` -- please see the diff on top of this for the motivation.
# How
In oder to mitigate this issue, we have to "batch" the call to `_set_params_and_buffers_to_ignore_for_model`. Therefore, we allow users to pass their params-to-be-ignored to the wrapper to batch with torchrec sharded params.
Reviewed By: dstaay-fb
Differential Revision: D58486022
fbshipit-source-id: 3896e02fec0cec7db528c265c7d0fbfdef1fea87
0 commit comments