-
Notifications
You must be signed in to change notification settings - Fork 152
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
[DataLoader2] Skip wrapping if serialization wrapper attached & deepcopy DataPipe in load_state_dict #833
Conversation
…opy DataPipe in load_state_dict
@ejguan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Question: do we expect any case where the datapipe
being passed in already has a wrapper?
It's more like a future proof. (Technically, if users manually |
…n load_state_dict (pytorch#833) Summary: Per title - We don't need to attach serialization wrapper if the last DataPipe has been `_DataPipeSerializationWrapper` - When we `load_state_dict`, we still need a copy of `self.datapipe` as it has been done in `__init__` function. We should either do deepcoy to `self._datapipe_before_reading_service_adapt` or skip deepcopy to `self._datapipe_before_reading_service_adapt` at those two places. Pull Request resolved: pytorch#833 Reviewed By: NivekT Differential Revision: D40399573 Pulled By: ejguan fbshipit-source-id: 16fc80bd005a4b8671d48780c7aea8f164bccba8
…n load_state_dict (#833) Summary: Per title - We don't need to attach serialization wrapper if the last DataPipe has been `_DataPipeSerializationWrapper` - When we `load_state_dict`, we still need a copy of `self.datapipe` as it has been done in `__init__` function. We should either do deepcoy to `self._datapipe_before_reading_service_adapt` or skip deepcopy to `self._datapipe_before_reading_service_adapt` at those two places. Pull Request resolved: #833 Reviewed By: NivekT Differential Revision: D40399573 Pulled By: ejguan fbshipit-source-id: 16fc80bd005a4b8671d48780c7aea8f164bccba8
…n load_state_dict (pytorch#833) Summary: Per title - We don't need to attach serialization wrapper if the last DataPipe has been `_DataPipeSerializationWrapper` - When we `load_state_dict`, we still need a copy of `self.datapipe` as it has been done in `__init__` function. We should either do deepcoy to `self._datapipe_before_reading_service_adapt` or skip deepcopy to `self._datapipe_before_reading_service_adapt` at those two places. Pull Request resolved: pytorch#833 Reviewed By: NivekT Differential Revision: D40399573 Pulled By: ejguan fbshipit-source-id: 16fc80bd005a4b8671d48780c7aea8f164bccba8
Per title
_DataPipeSerializationWrapper
load_state_dict
, we still need a copy ofself.datapipe
as it has been done in__init__
function. We should align the behavior ofload_state_dict
and__init__
self._datapipe_before_reading_service_adapt
self._datapipe_before_reading_service_adapt
at those two places.