-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[PyTorch] Redirect c10::optional to std::optional #101995
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
Conversation
We have C++17 now! I am intentionally dropping the c10::optional<c10::ArrayRef> size optimization. It was intended to improve dispatch, but thanks to D34602980 / #70864 we don't use optional<ArrayRef> in function arguments anymore anyway. Differential Revision: [D46079028](https://our.internmc.facebook.com/intern/diff/D46079028/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/101995
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit ac98e66 with merge base 597d3fb ( BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
We have C++17 now! I am intentionally dropping the c10::optional<c10::ArrayRef> size optimization. It was intended to improve dispatch, but thanks to D34602980 / #70864 we don't use optional<ArrayRef> in function arguments anymore anyway. Differential Revision: [D46079028](https://our.internmc.facebook.com/intern/diff/D46079028/) [ghstack-poisoned]
Pull Request resolved: #101995 We have C++17 now! I am intentionally dropping the c10::optional<c10::ArrayRef> size optimization. It was intended to improve dispatch, but thanks to D34602980 / #70864 we don't use optional<ArrayRef> in function arguments anymore anyway. ghstack-source-id: 189899247 Differential Revision: [D46079028](https://our.internmc.facebook.com/intern/diff/D46079028/)
albanD
left a comment
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.
Code change sounds fine, will let @malfet take the final look!
| // Non-trivial destructor. | ||
| std::string>; | ||
|
|
||
| // This assert is also in Optional.cpp; including here too to make it |
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.
cc @ezyang if you have more context about this
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.
This is @swolchok's optimization, he knows ;)
| template<typename T> | ||
| class optional; |
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.
Should we just say something like using optional = std::optional; and kill c10/util/Optional header?
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.
that'd be fine with me, but I've had to leave in #include <c10/macros/Macros.h> in c10/util/Optional.h for now because lots of files seem to depend on pulling in the Macros.h namespace shenanigans through Optional.h :(
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.
Agre with @malfet . This is how llvm handled their std::optional conversion.
We have C++17 now! I am intentionally dropping the c10::optional<c10::ArrayRef> size optimization. It was intended to improve dispatch, but thanks to D34602980 / #70864 we don't use optional<ArrayRef> in function arguments anymore anyway. Differential Revision: [D46079028](https://our.internmc.facebook.com/intern/diff/D46079028/) cc ezyang gchanan EikanWang jgong5 [ghstack-poisoned]
We have C++17 now! I am intentionally dropping the c10::optional<c10::ArrayRef> size optimization. It was intended to improve dispatch, but thanks to D34602980 / #70864 we don't use optional<ArrayRef> in function arguments anymore anyway. Differential Revision: [D46079028](https://our.internmc.facebook.com/intern/diff/D46079028/) cc ezyang gchanan EikanWang jgong5 [ghstack-poisoned]
…d::optional doesn't pass them on "[PyTorch] Redirect c10::optional to std::optional" We have C++17 now! I am intentionally dropping the c10::optional<c10::ArrayRef> size optimization. It was intended to improve dispatch, but thanks to D34602980 / #70864 we don't use optional<ArrayRef> in function arguments anymore anyway. Differential Revision: [D46079028](https://our.internmc.facebook.com/intern/diff/D46079028/) cc ezyang gchanan EikanWang jgong5 [ghstack-poisoned]
Merge failedReason: This PR has internal changes and must be landed via Phabricator Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
@pytorchbot merge -f "Before rebase everything was green but executorch, see https://hud.pytorch.org/pytorch/pytorch/pull/101995?sha=18faa09012ed31baa8c37cce184dcbe36202d9ba " |
|
The merge job was canceled. If you believe this is a mistake, then you can re trigger it through pytorch-bot. |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Should have been landed together with #101995
Should have been landed together with #101995 Includes pytorch/FBGEMM@de731af Pull Request resolved: #114847 Approved by: https://github.com/kit1980, https://github.com/huydhn
We have C++17 now! I am intentionally dropping the `c10::optional<c10::ArrayRef>` size optimization. It was intended to improve dispatch, but thanks to D34602980 / pytorch#70864 we don't use `optional<ArrayRef>` in function arguments anymore anyway. Differential Revision: [D46079028](https://our.internmc.facebook.com/intern/diff/D46079028/) Pull Request resolved: pytorch#101995 Approved by: https://github.com/malfet, https://github.com/Skylion007, https://github.com/ezyang
Should have been landed together with pytorch#101995 Includes pytorch/FBGEMM@de731af Pull Request resolved: pytorch#114847 Approved by: https://github.com/kit1980, https://github.com/huydhn
pytorch#2138) Summary: X-link: pytorch/executorch#1226 Pull Request resolved: pytorch#2138 Landing non-PyTorch portions first; then the PyTorch portions of pytorch/pytorch#101995 will land to Github. Reviewed By: malfet Differential Revision: D51355841 fbshipit-source-id: 4eed885733189f21e342613431b637de72979cb4
Stack from ghstack (oldest at bottom):
We have C++17 now!
I am intentionally dropping the
c10::optional<c10::ArrayRef>size optimization. It was intended to improve dispatch, but thanks to D34602980 / #70864 we don't useoptional<ArrayRef>in function arguments anymore anyway.Differential Revision: D46079028
cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu @penguinwu @fegin @XilunWu @wanchaol @fduwjj @wz337 @tianyu-l @wconstab @yf225 @ezyang @gchanan @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @EikanWang @kiukchung @d4l3k @LucasLLC