Skip to content

[PyTorch] Redirect c10::optional to std::optional#101995

Closed
swolchok wants to merge 35 commits intogh/swolchok/574/basefrom
gh/swolchok/574/head
Closed

[PyTorch] Redirect c10::optional to std::optional#101995
swolchok wants to merge 35 commits intogh/swolchok/574/basefrom
gh/swolchok/574/head

Conversation

@swolchok
Copy link
Contributor

@swolchok swolchok commented May 22, 2023

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 use optional<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

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]
@pytorch-bot
Copy link

pytorch-bot bot commented May 22, 2023

🔗 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 (image):

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]
swolchok added a commit that referenced this pull request May 22, 2023
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/)
@github-actions github-actions bot added the NNC label May 22, 2023
@pytorch-bot pytorch-bot bot added the release notes: distributed (c10d) release notes category label May 22, 2023
Copy link
Collaborator

@albanD albanD left a 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
Copy link
Collaborator

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

Copy link
Contributor

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 ;)

@malfet malfet added the topic: bc breaking topic category label May 22, 2023
@albanD albanD added the module: bc-breaking Related to a BC-breaking change label May 22, 2023
Comment on lines -7 to -8
template<typename T>
class optional;
Copy link
Contributor

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?

Copy link
Contributor Author

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 :(

Copy link
Collaborator

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]
swolchok added a commit to swolchok/FBGEMM that referenced this pull request Nov 27, 2023
pytorch#2138)

Summary:
X-link: pytorch/executorch#1226


Landing non-PyTorch portions first; then the PyTorch portions of  pytorch/pytorch#101995 will land to Github.

Reviewed By: malfet

Differential Revision: D51355841
swolchok added a commit to swolchok/executorch that referenced this pull request Nov 27, 2023
pytorch#1226)

Summary:

X-link: pytorch/FBGEMM#2138

Landing non-PyTorch portions first; then the PyTorch portions of  pytorch/pytorch#101995 will land to Github.

Reviewed By: malfet

Differential Revision: D51355841
swolchok added a commit to swolchok/FBGEMM that referenced this pull request Nov 27, 2023
pytorch#2138)

Summary:
X-link: pytorch/executorch#1226


Landing non-PyTorch portions first; then the PyTorch portions of  pytorch/pytorch#101995 will land to Github.

Reviewed By: malfet

Differential Revision: D51355841
swolchok added a commit to swolchok/executorch that referenced this pull request Nov 27, 2023
pytorch#1226)

Summary:

X-link: pytorch/FBGEMM#2138

Landing non-PyTorch portions first; then the PyTorch portions of  pytorch/pytorch#101995 will land to Github.

Reviewed By: malfet

Differential Revision: D51355841
facebook-github-bot pushed a commit to pytorch/executorch that referenced this pull request Nov 28, 2023
#1226)

Summary:
Pull Request resolved: #1226

X-link: pytorch/FBGEMM#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
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 jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 EikanWang

[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 jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 EikanWang H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab mrshenli zhaojuanmao rohan-varma kiukchung d4l3k lucasllc XilunWu tianyu-l

[ghstack-poisoned]
@swolchok
Copy link
Contributor Author

looks like we're just waiting for the next executorch pinned commit bump

@cyyever
Copy link
Collaborator

cyyever commented Nov 29, 2023

The test failure may be unrelated and can be ignored.

@swolchok
Copy link
Contributor Author

The test failure may be unrelated and can be ignored.

it's definitely related. pytorch/executorch@61aad49 used to be part of this PR but I had to split it out, and we need it pulled in so that this PR won't break the build.

#114717 will update us.

@malfet
Copy link
Contributor

malfet commented Nov 30, 2023

@pytorchbot rebase -b main

@malfet
Copy link
Contributor

malfet commented Nov 30, 2023

Considering that all other tests were green, we just need to wait for executorch tests to pass to merge this

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/main. Check the current status here

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 jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 EikanWang H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab mrshenli zhaojuanmao rohan-varma kiukchung d4l3k lucasllc XilunWu tianyu-l

[ghstack-poisoned]
@pytorchmergebot
Copy link
Collaborator

Successfully rebased gh/swolchok/574/orig onto refs/remotes/origin/main, please pull locally before adding more changes (for example, via ghstack checkout https://github.com/pytorch/pytorch/pull/101995)

@malfet
Copy link
Contributor

malfet commented Nov 30, 2023

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: This PR has internal changes and must be landed via Phabricator

Details for Dev Infra team Raised by workflow job

@malfet
Copy link
Contributor

malfet commented Nov 30, 2023

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: This PR has internal changes and must be landed via Phabricator

Details for Dev Infra team Raised by workflow job

@malfet
Copy link
Contributor

malfet commented Nov 30, 2023

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@malfet
Copy link
Contributor

malfet commented Nov 30, 2023

@pytorchbot merge -f "Before rebase everything was green but executorch, see https://hud.pytorch.org/pytorch/pytorch/pull/101995?sha=18faa09012ed31baa8c37cce184dcbe36202d9ba "

@pytorchmergebot
Copy link
Collaborator

The merge job was canceled. If you believe this is a mistake, then you can re trigger it through pytorch-bot.

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged module: bc-breaking Related to a BC-breaking change module: cpu CPU specific problem (e.g., perf, algorithm) NNC oncall: distributed Add this issue/PR to distributed oncall triage queue release notes: distributed (c10d) release notes category release notes: quantization release notes category topic: bc breaking topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants