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
Refactoring and renaming to KeyZipper to IterKeyZipper and MapZipper to MapKeyZipper #50
Conversation
[ghstack-poisoned]
ghstack-source-id: 103429968438a8f9cc64321d85fe71284838ee78 Pull Request resolved: #50
The linting error will go away when this PR lands. |
@NivekT has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Let me discuss with domains about how to maintain BC breaking change before we land it. |
Since `MapZipper` has been added, the name `KeyZipper` is confusing and should be changed to `IterZipper` instead. Differential Revision: [D31487393](https://our.internmc.facebook.com/intern/diff/D31487393) [ghstack-poisoned]
ghstack-source-id: b38cd6e5ea96df7b5bec62c4d3096a1a6f64fe35 Pull Request resolved: #50
@NivekT has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Let me know if there is any follow up related to this. |
Sorry for the delay. The POC from Vision is on PTO this week. Have to wait until he is back. |
Okay no problem. |
Fixes #44 by adding merge function as an optional input for `KeyZipper`. It allows user to specify how the items yielded from the DataPipes will be combined before they are yielded. This PR changes the default behavior when `keep_key=True` and that may be BC breaking. Previously, when `keep_key=True`, the output will be `(key, item1, item2)`, now it will default to `(key, (item1, item2)`. It is possible to leave the default behavior unchanged. Note that `KeyZipper` may be renamed to `IterZipper` in #50 to provide users with better clarity. [ghstack-poisoned]
Fixes #44 by adding merge function as an optional input for `KeyZipper`. It allows user to specify how the items yielded from the DataPipes will be combined before they are yielded. This PR changes the default behavior when `keep_key=True` and that may be BC breaking. Previously, when `keep_key=True`, the output will be `(key, item1, item2)`, now it will default to `(key, (item1, item2)`. It is possible to leave the default behavior unchanged. Note that `KeyZipper` may be renamed to `IterZipper` in #50 to provide users with better clarity. Differential Revision: [D31820203](https://our.internmc.facebook.com/intern/diff/D31820203) [ghstack-poisoned]
Summary: Pull Request resolved: #76 Fixes #44 by adding merge function as an optional input for `KeyZipper`. It allows user to specify how the items yielded from the DataPipes will be combined before they are yielded. This PR changes the default behavior when `keep_key=True` and that may be BC breaking. Previously, when `keep_key=True`, the output will be `(key, item1, item2)`, now it will default to `(key, (item1, item2)`. It is possible to leave the default behavior unchanged. Note that `KeyZipper` may be renamed to `IterZipper` in #50 to provide users with better clarity. Test Plan: Imported from OSS Reviewed By: ejguan Differential Revision: D31820203 Pulled By: NivekT fbshipit-source-id: 670941e03595f0b0013c1162cfe1c22ec3ce6064
Since `MapZipper` has been added, the name `KeyZipper` is confusing and should be changed to `IterZipper` instead. Note that this renaming is BC breaking for users. Differential Revision: [D31487393](https://our.internmc.facebook.com/intern/diff/D31487393) [ghstack-poisoned]
ghstack-source-id: 9743b148616a8a5814af2a28d03f0b6253cee758 Pull Request resolved: #50
@ejguan any update on this thread? We can also add a deprecation warning and keep the old name working in the meantime. |
@ejguan Since TorchVision is fine with this change, can we land it (maybe next week so that they can change things downstream as well)? Or do we need to follow up with TorchText too? |
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.
Let's add Philip to see if there is objection
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.
Won't that be quite confusing when we still have the Zipper
datapipe?
data/torchdata/datapipes/iter/__init__.py
Line 12 in ac54cae
Zipper, |
Given that it is also an IterDataPipe
, you can't know which does what from the names: IterZipper
vs Zipper
. Maybe name it IterKeyZipper
?
I think |
Since `MapZipper` has been added, the name `KeyZipper` is confusing and should be changed to `IterZipper` instead. Note that this renaming is BC breaking for users. Differential Revision: [D31487393](https://our.internmc.facebook.com/intern/diff/D31487393) [ghstack-poisoned]
ghstack-source-id: fdd2b8aa0a73cd1138e658af42973c99fa6ef3f9 Pull Request resolved: #50
@NivekT has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@pmeier I am importing this PR and will land it later today with |
Will you also rename |
No, there will be no change to |
Why not? If this PR is landed we would have
IIUC, |
Because data/torchdata/datapipes/iter/util/combining.py Lines 106 to 119 in ca621af
I am open to the possibility that @ejguan maybe you want to weight in on this as well |
Ohh, I'm sorry. I think I misunderstood the issue. IMO,
would be best then. |
Great, I think that is more reasonable as well. I will rename |
Since `MapZipper` has been added, the name `KeyZipper` is confusing and should be changed to `IterKeyZipper` instead. Note that this renaming is BC breaking for users. Differential Revision: [D31487393](https://our.internmc.facebook.com/intern/diff/D31487393) [ghstack-poisoned]
…to MapKeyZipper ghstack-source-id: 15a64f5716549fd0c9fd5b64f8ad4b728e80babe Pull Request resolved: #50
@NivekT has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@pmeier I will likely land this tomorrow morning (US EST). I will let you know so you can land the other PR as well. Thanks! |
This is great. |
Stack from ghstack:
Since
MapZipper
has been added, the nameKeyZipper
is confusing and should be changed toIterKeyZipper
instead. We are also changingMapZipper
toMapKeyZipper
to ensure the names stay matching.Note that this renaming is BC breaking for users.
Differential Revision: D31487393