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

implement with fewer afoldl methods #39414

Merged
merged 2 commits into from
Jan 27, 2021
Merged

implement with fewer afoldl methods #39414

merged 2 commits into from
Jan 27, 2021

Conversation

vtjnash
Copy link
Sponsor Member

@vtjnash vtjnash commented Jan 27, 2021

With constant-propagation, inference (and Varargs runtime) is likely
better able to handle this version now (and it removes the n^2 behavior
definitions for semi-low argument counts).

Now we also need to force Vararg specialization up to 16 arguments
manually, so we do that explicitly (and slightly hack-y).

Closes #39175, as this fixes the regression, though it appears in my testing that #35675 also work very well here (permits inlining at a different layer, where it is more effective over a broader scope than just this regression)

With constant-propagation, inference (and Varargs runtime) is likely
better able to handle this version now (and it removes the n^2 behavior
definitions for semi-low argument counts).

Now we also need to force Vararg specialization up to 16 arguments
manually, so we do that explicitly (and slightly hack-y).

Fixes regression in #39175
@vtjnash vtjnash added the backport 1.6 Change should be backported to release-1.6 label Jan 27, 2021
@KristofferC KristofferC mentioned this pull request Jan 27, 2021
60 tasks
base/operators.jl Outdated Show resolved Hide resolved
end
typeof(afoldl).name.mt.max_args = 18
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

🙈

afoldl(op,a,b) = op(a,b)
afoldl(op,a,b,c...) = afoldl(op, op(a,b), c...)
function afoldl(op,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,qs...)
y = op(op(op(op(op(op(op(op(op(op(op(op(op(op(op(a,b),c),d),e),f),g),h),i),j),k),l),m),n),o),p)
Copy link
Member

Choose a reason for hiding this comment

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

This line 😂

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

I know; sad we have to drop one of my favorite lines of code 😂

Copy link
Member

@Sacha0 Sacha0 left a comment

Choose a reason for hiding this comment

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

Huh neat approach! :)

Co-authored-by: Jeff Bezanson <[email protected]>
@vtjnash vtjnash merged commit 5cd1e3e into master Jan 27, 2021
@vtjnash vtjnash deleted the jn/39175 branch January 27, 2021 22:13
KristofferC pushed a commit that referenced this pull request Jan 29, 2021
With constant-propagation, inference (and Varargs runtime) is likely
better able to handle this version now (and it removes the n^2 behavior
definitions for semi-low argument counts).

Now we also need to force Vararg specialization up to 16 arguments
manually, so we do that explicitly (and slightly hack-y).

Fixes regression in #39175

(cherry picked from commit 5cd1e3e)
@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label Feb 1, 2021
KristofferC pushed a commit that referenced this pull request Feb 1, 2021
With constant-propagation, inference (and Varargs runtime) is likely
better able to handle this version now (and it removes the n^2 behavior
definitions for semi-low argument counts).

Now we also need to force Vararg specialization up to 16 arguments
manually, so we do that explicitly (and slightly hack-y).

Fixes regression in #39175

(cherry picked from commit 5cd1e3e)
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this pull request May 4, 2021
With constant-propagation, inference (and Varargs runtime) is likely
better able to handle this version now (and it removes the n^2 behavior
definitions for semi-low argument counts).

Now we also need to force Vararg specialization up to 16 arguments
manually, so we do that explicitly (and slightly hack-y).

Fixes regression in JuliaLang#39175
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this pull request May 9, 2021
With constant-propagation, inference (and Varargs runtime) is likely
better able to handle this version now (and it removes the n^2 behavior
definitions for semi-low argument counts).

Now we also need to force Vararg specialization up to 16 arguments
manually, so we do that explicitly (and slightly hack-y).

Fixes regression in JuliaLang#39175
staticfloat pushed a commit that referenced this pull request Dec 23, 2022
With constant-propagation, inference (and Varargs runtime) is likely
better able to handle this version now (and it removes the n^2 behavior
definitions for semi-low argument counts).

Now we also need to force Vararg specialization up to 16 arguments
manually, so we do that explicitly (and slightly hack-y).

Fixes regression in #39175

(cherry picked from commit 5cd1e3e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

inference regression on afoldl
4 participants