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

apply_type_tfunc: add heuristic complexity limit #49167

Merged
merged 1 commit into from
Apr 10, 2023
Merged

apply_type_tfunc: add heuristic complexity limit #49167

merged 1 commit into from
Apr 10, 2023

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Mar 27, 2023

In #48421 we removed all limits from apply_type, but that can lead to significant expression complexity which may be hard for subtyping to deal with. Try adding a heuristic size limiting constraint. Also do a bunch of code rearrangement and slight cleanup so that this change does not make the logic look complicated here.

Solves #49127

Note that this can cause the existing severe performance problems for tests like LinearAlgebra/addmul to become even more severe. But some of my other recent PRs to fix the lowering issues that seem to be major causes of that will hopefully alleviate that particular issue.

@vtjnash vtjnash requested a review from aviatesk March 27, 2023 20:11
In #48421 we removed all limits from apply_type, but that can lead to
significant expression complexity which may be hard for subtyping to
deal with. Try adding a heuristic size limiting constraint.
Also do a bunch of code rearrangement and slight cleanup so that this
change does not make the logic look complicated here.

Solves #49127
@vtjnash
Copy link
Member Author

vtjnash commented Apr 4, 2023

@nanosoldier runbenchmarks(!"scalar", vs=":master")

@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Apr 4, 2023
@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here.

Copy link
Member

@aviatesk aviatesk left a comment

Choose a reason for hiding this comment

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

SGTM.

@aviatesk aviatesk merged commit 94da492 into master Apr 10, 2023
@aviatesk aviatesk deleted the jn/49127 branch April 10, 2023 12:08
@giordano giordano removed the merge me PR is reviewed. Merge when all tests are passing label Apr 11, 2023
Xnartharax pushed a commit to Xnartharax/julia that referenced this pull request Apr 19, 2023
In JuliaLang#48421 we removed all limits from apply_type, but that can lead to
significant expression complexity which may be hard for subtyping to
deal with. Try adding a heuristic size limiting constraint.
Also do a bunch of code rearrangement and slight cleanup so that this
change does not make the logic look complicated here.

Solves JuliaLang#49127
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.

4 participants