Skip to content

Making ops c10-full: Generator arguments#49013

Closed
smessmer wants to merge 22 commits intogh/smessmer/277/basefrom
gh/smessmer/277/head
Closed

Making ops c10-full: Generator arguments#49013
smessmer wants to merge 22 commits intogh/smessmer/277/basefrom
gh/smessmer/277/head

Conversation

@smessmer
Copy link
Copy Markdown
Contributor

@smessmer smessmer commented Dec 8, 2020

Stack from ghstack:

I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: D25394998

I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
smessmer added a commit that referenced this pull request Dec 8, 2020
I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

ghstack-source-id: 118081571
Pull Request resolved: #49013
@dr-ci
Copy link
Copy Markdown

dr-ci bot commented Dec 8, 2020

💊 CI failures summary and remediations

As of commit ba167fd (more details on the Dr. CI page):


  • 1/1 failures introduced in this PR

🕵️ 1 new failure recognized by patterns

The following CI failures do not appear to be due to upstream breakages:

See CircleCI build pytorch_xla_linux_bionic_py3_6_clang9_build (1/1)

Step: "Build" (full log | diagnosis details | 🔁 rerun)

Dec 15 18:45:44 Failed to generate ATEN bindings: ['/var/lib/jenkins/workspace/xla/scripts/generate_code.sh']
Dec 15 18:45:43 AtenXlaType function missed override: std::tuple<Tensor&, Tensor&> min_out(Tensor& min, Tensor& min_indices, const Tensor& self, int64_t dim, bool keepdim); // min_out(Tensor,Tensor,Tensor,int64_t,bool)->std::tuple<Tensor,Tensor>
Dec 15 18:45:43 Traceback (most recent call last):
Dec 15 18:45:43   File "/var/lib/jenkins/workspace/xla/scripts/gen.py", line 1172, in <module>
Dec 15 18:45:43     generate(args)
Dec 15 18:45:43   File "/var/lib/jenkins/workspace/xla/scripts/gen.py", line 1142, in generate
Dec 15 18:45:43     assert check_overrides(overrides, overridden)
Dec 15 18:45:43 AssertionError
Dec 15 18:45:44 Building torch_xla version: 1.6
Dec 15 18:45:44 XLA Commit ID: fe89172b2bd1c9a1c104bd2cbe565f30e6c8e328
Dec 15 18:45:44 PyTorch Commit ID: b1e59d59dc19e5978a7c08a0cd57cd1409d1302c
Dec 15 18:45:44 Failed to generate ATEN bindings: ['/var/lib/jenkins/workspace/xla/scripts/generate_code.sh']
Dec 15 18:45:44 =================== sccache compilation log ===================
Dec 15 18:45:44 + cleanup
Dec 15 18:45:44 + retcode=1
Dec 15 18:45:44 + set +x
Dec 15 18:45:44 =========== If your build fails, please take a look at the log above for possible reasons ===========
Dec 15 18:45:44 Compile requests                    4562
Dec 15 18:45:44 Compile requests executed           4268
Dec 15 18:45:44 Cache hits                          3141
Dec 15 18:45:44 Cache hits (C/C++)                  3141
Dec 15 18:45:44 Cache misses                        1109

XLA failure

Job pytorch_xla_linux_bionic_py3_6_clang9_build is failing. Please create an issue with title prefixed by [PT_BREAK] in pytorch/xla and link to to this PR. If you have questions, please reach out to @ailzhang / @dlibenzi / @JackCaoG.

This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

This comment has been revised 115 times.

@smessmer smessmer requested review from bhosmer and ezyang December 8, 2020 13:44
I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
smessmer added a commit that referenced this pull request Dec 8, 2020
Pull Request resolved: #49013

I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.
ghstack-source-id: 118097566

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)
I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
smessmer added a commit that referenced this pull request Dec 8, 2020
Pull Request resolved: #49013

I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.
ghstack-source-id: 118116629

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)
Copy link
Copy Markdown

@bhosmer bhosmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's plausible to stop dispatching on Generator for unboxed, is it? That would necessitate a redesign of the current RNG approach AIUI.

Agree that we should teach DispatchKeyExtractor about Generator and run some perf tests. But I don't imagine Generator scanning per se will affect perf much - I'd think the change would be dominated by the move from generated unboxing wrappers to the boxed protocol, no? (And as such, should we have some comparison numbers further up the stack for other ops that have made the same transition?)

@bhosmer
Copy link
Copy Markdown

bhosmer commented Dec 9, 2020

onnx errors look real btw

I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
smessmer added a commit that referenced this pull request Dec 9, 2020
Pull Request resolved: #49013

I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.
ghstack-source-id: 118177107

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)
I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
@smessmer
Copy link
Copy Markdown
Contributor Author

smessmer commented Dec 9, 2020

I found an old issue about this: #36733
This issue is long standing and this PR shouldn't change anything, it doesn't work before and it doesn't work after. I think we can go ahead and land this.

I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.

Differential Revision: [D25394998](https://our.internmc.facebook.com/intern/diff/D25394998/)

[ghstack-poisoned]
facebook-github-bot pushed a commit that referenced this pull request Dec 15, 2020
Summary:
Pull Request resolved: #49013

I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.
ghstack-source-id: 118619230

(Note: this ignores all push blocking failures!)

Test Plan: waitforsandcastle

Reviewed By: bhosmer

Differential Revision: D25394998

fbshipit-source-id: f695c659ee6e3738f74cdf0af1a514ac0c30ebff
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in ba3bcab.

@facebook-github-bot facebook-github-bot deleted the gh/smessmer/277/head branch December 19, 2020 15:18
jiafatom pushed a commit to jiafatom/pytorch that referenced this pull request Dec 21, 2020
Summary:
Pull Request resolved: pytorch#49013

I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.
ghstack-source-id: 118619230

(Note: this ignores all push blocking failures!)

Test Plan: waitforsandcastle

Reviewed By: bhosmer

Differential Revision: D25394998

fbshipit-source-id: f695c659ee6e3738f74cdf0af1a514ac0c30ebff
ts-alchemist659op added a commit to ts-alchemist659op/csprng that referenced this pull request Oct 20, 2025
Summary:
Pull Request resolved: pytorch/pytorch#49013

I don't know why this works. I know, this is never a good way to start a PR description :P
I know that Generator is a dispatch relevant argument when called from an unboxed API and is ignored
for dispatch purposes when called from a boxed API. This should break something, but maybe we don't
have test cases for that.

We likely need to align the unboxed and boxed dispatch behavior before landing this.
The best solution would be to make Generator not dispatch relevant in unboxing. But that might be a bigger change.
An acceptable solution could be to make Generator dispatch relevant in boxing, but that needs perf measurements.

This PR needs further discussion.
ghstack-source-id: 118619230

(Note: this ignores all push blocking failures!)

Reviewed By: bhosmer

Differential Revision: D25394998

fbshipit-source-id: f695c659ee6e3738f74cdf0af1a514ac0c30ebff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants