Skip to content
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

Making ops c10-full: optional lists #49088

Closed
wants to merge 20 commits into from

Conversation

smessmer
Copy link
Contributor

@smessmer smessmer commented Dec 9, 2020

Stack from ghstack:

We had special case logic to support int[]? and double[]? but nothing for DimnameList[]?.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using torch::List instead of ArrayRef, that could work without copying the list.

Differential Revision: D25423901

We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
smessmer added a commit that referenced this pull request Dec 9, 2020
We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

ghstack-source-id: 118184335
Pull Request resolved: #49088
@dr-ci
Copy link

dr-ci bot commented Dec 9, 2020

💊 CI failures summary and remediations

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


💚 💚 Looks good so far! There are no failures yet. 💚 💚


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 83 times.

We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
@ezyang ezyang requested a review from swolchok December 10, 2020 03:09
We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

Vector allocation here is still giving me hives. It looks like the operators affected here are only cold names operators though. @swolchok I cc'ed you specifically about the vector allocation in aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h

@swolchok
Copy link
Contributor

Vector allocation here is still giving me hives. It looks like the operators affected here are only cold names operators though. @swolchok I cc'ed you specifically about the vector allocation in aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h

I don’t see a new allocation in that file, just a generalization of existing special cases. What am I missing?

We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
@ezyang
Copy link
Contributor

ezyang commented Dec 10, 2020

I don’t see a new allocation in that file, just a generalization of existing special cases. What am I missing?

I don't think this PR makes it worse. But it touches code that is not so great.

We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.

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

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in ec8e9d3.

@facebook-github-bot facebook-github-bot deleted the gh/smessmer/281/head branch December 19, 2020 15:18
hwangdeyu pushed a commit to hwangdeyu/pytorch that referenced this pull request Jan 6, 2021
Summary:
Pull Request resolved: pytorch#49088

We had special case logic to support `int[]?` and `double[]?` but nothing for `DimnameList[]?`.
This PR generalizes the logic to support optional lists so it should now work with all types.
It also enables c10-fullness for ops that were blocked by this.

Note that using these arguments in a signature was always and still is expensive because the whole list needs to be copied.
We should probably consider alternatives in the future like for example using `torch::List` instead of `ArrayRef`, that could work without copying the list.
ghstack-source-id: 118660071

Test Plan: waitforsandcastle

Reviewed By: ezyang

Differential Revision: D25423901

fbshipit-source-id: dec58dc29f3bb4cbd89e2b95c42da204a9da2e0a
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.

None yet

5 participants