Change ATEN generator argument type to const std::optional<Generator>𝔌
Change ATEN generator argument type to const std::optional<Generator>𝔌cyyever wants to merge 4 commits intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/120076
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit 231c64d with merge base 52e9049 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
3518e8c to
9282a25
Compare
dc335cc to
0cd72e6
Compare
0cd72e6 to
0449699
Compare
0449699 to
2964598
Compare
2964598 to
19e827f
Compare
|
This is still not an optimal type for Generator, because if you have a We have an analogous problem with optional tensors, and ultimately we had to do a trick with OptionalTensorRef to get the efficient version. If we're going through all the trouble of changing the API here, we probably should do this here too. |
malfet
left a comment
There was a problem hiding this comment.
Sure, but as you change this code anyway, do you mind using std::optional (as c10::optional is a soon to be deprecated alias)
19e827f to
1fc4132
Compare
|
@pytorchbot revert -m "Reverting in order to check if this will fix XLA trunk jobs" -c ignoredsignal |
|
@pytorchbot successfully started a revert job. Check the current status here. |
…nerator>& (#120076)" This reverts commit ecbe82b. Reverted #120076 on behalf of https://github.com/jeanschmidt due to Reverting in order to check if this will fix XLA trunk jobs ([comment](#120076 (comment)))
|
@cyyever your PR has been successfully reverted. |
6713030 to
063d1f0
Compare
|
@pytorchmergebot merge -i |
Merge startedYour change will be merged while ignoring the following 2 checks: linux-binary-conda / conda-py3_10-cuda11_8-build / build, trunk / win-vs2019-cpu-py3 / test (default, 1, 3, windows.4xlarge.nonephemeral) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…p.py (#121415) This PR is a follow-up of #120076, it moves std::optional<Generator> detection logic into ```valuetype_type``` of api/cpp.py by adding the mutable parameter, which facilitates future value type changes. Pull Request resolved: #121415 Approved by: https://github.com/ezyang
|
HI This fails internally with error: Pointing to this csprng : https://github.com/pytorch/csprng/blob/main/torchcsprng/csrc/csprng.cpp#L344 |
|
@pytorchbot revert -m "breaking internal builds" -c ghfirst |
|
@pytorchbot successfully started a revert job. Check the current status here. |
…nerator>& (#120076)" This reverts commit a52b4e2. Reverted #120076 on behalf of https://github.com/atalman due to breaking internal builds ([comment](#120076 (comment)))
|
@cyyever your PR has been successfully reverted. |
|
@alanwaketan @ezyang https://github.com/pytorch/csprng should be updated for this PR, how can we do that because we didn't have a coordination protocol like PyTorch/XLA? |
|
@cyyever I guess I will need to revert your change in PyTorch/XLA for now? |
|
@cyyever At this point, you might have to just take the long way around and add BC logic that can handle the old overload types. Fortunately, it should be possible to detect them from C++ metaprogramming and then you can transparently shim them to the new type. If you still want to try landing directly again, we will need to make this an fbcode first diff, as the csprng will need to be landed simultaneously to fbcode. That means someone at Meta has to volunteer to shepherd the rest of the patch. |
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
This PR proposes to use std::optional& for underlying functions to avoid unnecessary copy and move operations. The torchgen code was changed to generate the new type.
cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10