-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Improve inferability of shape::Dims for cat #39294
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`cat` is often called with Varargs or heterogenous inputs, and inference almost always fails. Even when all the arrays are of the same type, if the number of varargs isn't known inference typically fails. The culprit is probably #36454. This reduces the number of failures considerably, by avoiding creation of vararg length tuples in the shape-inference pipeline.
Sacha0
reviewed
Jan 17, 2021
Would this help with #21673? |
Seems likely that at least one of this and #39292 should help, but I haven't tested. |
For me, on the benchmark in #21673 master yields julia> @btime test1(20)
2.448 μs (34 allocations: 1.56 KiB) whereas this branch yields julia> @btime test1(20)
1.052 μs (15 allocations: 864 bytes) and the branch in #39292 yields
So they both help. |
timholy
commented
Jan 19, 2021
timholy
added a commit
that referenced
this pull request
Jan 19, 2021
The `cat` pipeline has long had poor inferrability. Together with #39292 and #39294, this should basically put an end to that problem. Together, at least in simple cases these make the performance of `cat` essentially equivalent to the manual version. In other words, the `test1` and `test2` of #21673 benchmark very similarly.
The final fix is in #39314. |
timholy
added a commit
that referenced
this pull request
Jan 20, 2021
The `cat` pipeline has long had poor inferrability. Together with #39292 and #39294, this should basically put an end to that problem. Together, at least in simple cases these make the performance of `cat` essentially equivalent to the manual version. In other words, the `test1` and `test2` of #21673 benchmark very similarly.
KristofferC
pushed a commit
that referenced
this pull request
Jan 20, 2021
`cat` is often called with Varargs or heterogenous inputs, and inference almost always fails. Even when all the arrays are of the same type, if the number of varargs isn't known inference typically fails. The culprit is probably #36454. This reduces the number of failures considerably, by avoiding creation of vararg length tuples in the shape-inference pipeline. (cherry picked from commit 815076b)
KristofferC
pushed a commit
that referenced
this pull request
Jan 20, 2021
The `cat` pipeline has long had poor inferrability. Together with #39292 and #39294, this should basically put an end to that problem. Together, at least in simple cases these make the performance of `cat` essentially equivalent to the manual version. In other words, the `test1` and `test2` of #21673 benchmark very similarly. (cherry picked from commit 78d55e2)
KristofferC
pushed a commit
that referenced
this pull request
Feb 1, 2021
`cat` is often called with Varargs or heterogenous inputs, and inference almost always fails. Even when all the arrays are of the same type, if the number of varargs isn't known inference typically fails. The culprit is probably #36454. This reduces the number of failures considerably, by avoiding creation of vararg length tuples in the shape-inference pipeline. (cherry picked from commit 815076b)
KristofferC
pushed a commit
that referenced
this pull request
Feb 1, 2021
The `cat` pipeline has long had poor inferrability. Together with #39292 and #39294, this should basically put an end to that problem. Together, at least in simple cases these make the performance of `cat` essentially equivalent to the manual version. In other words, the `test1` and `test2` of #21673 benchmark very similarly. (cherry picked from commit 78d55e2)
ElOceanografo
pushed a commit
to ElOceanografo/julia
that referenced
this pull request
May 4, 2021
`cat` is often called with Varargs or heterogenous inputs, and inference almost always fails. Even when all the arrays are of the same type, if the number of varargs isn't known inference typically fails. The culprit is probably JuliaLang#36454. This reduces the number of failures considerably, by avoiding creation of vararg length tuples in the shape-inference pipeline.
ElOceanografo
pushed a commit
to ElOceanografo/julia
that referenced
this pull request
May 4, 2021
The `cat` pipeline has long had poor inferrability. Together with JuliaLang#39292 and JuliaLang#39294, this should basically put an end to that problem. Together, at least in simple cases these make the performance of `cat` essentially equivalent to the manual version. In other words, the `test1` and `test2` of JuliaLang#21673 benchmark very similarly.
antoine-levitt
pushed a commit
to antoine-levitt/julia
that referenced
this pull request
May 9, 2021
`cat` is often called with Varargs or heterogenous inputs, and inference almost always fails. Even when all the arrays are of the same type, if the number of varargs isn't known inference typically fails. The culprit is probably JuliaLang#36454. This reduces the number of failures considerably, by avoiding creation of vararg length tuples in the shape-inference pipeline.
antoine-levitt
pushed a commit
to antoine-levitt/julia
that referenced
this pull request
May 9, 2021
The `cat` pipeline has long had poor inferrability. Together with JuliaLang#39292 and JuliaLang#39294, this should basically put an end to that problem. Together, at least in simple cases these make the performance of `cat` essentially equivalent to the manual version. In other words, the `test1` and `test2` of JuliaLang#21673 benchmark very similarly.
staticfloat
pushed a commit
that referenced
this pull request
Dec 23, 2022
`cat` is often called with Varargs or heterogenous inputs, and inference almost always fails. Even when all the arrays are of the same type, if the number of varargs isn't known inference typically fails. The culprit is probably #36454. This reduces the number of failures considerably, by avoiding creation of vararg length tuples in the shape-inference pipeline. (cherry picked from commit 815076b)
staticfloat
pushed a commit
that referenced
this pull request
Dec 23, 2022
The `cat` pipeline has long had poor inferrability. Together with #39292 and #39294, this should basically put an end to that problem. Together, at least in simple cases these make the performance of `cat` essentially equivalent to the manual version. In other words, the `test1` and `test2` of #21673 benchmark very similarly. (cherry picked from commit 78d55e2)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
cat
is often called with Varargs or heterogenous inputs,and in such cases inference almost always fails. Even when all the arrays
are of the same type, if the number of varargs isn't known
inference typically fails. The culprit is probably #36454.
This reduces the number of failures considerably, by avoiding
creation of vararg length tuples in the shape-inference pipeline.