-
-
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
set default max_methods to 3 #36208
set default max_methods to 3 #36208
Conversation
@nanosoldier |
Your package evaluation job has completed - possible new issues were detected. A full report can be found here. cc @maleadt |
Could this be back-ported to 1.5 (9 to 0.4 sec. would be really nice, also if similar other latency PRs)? Assuming it gets merged: In nanosoldier (that I'm new to): "GC corruption detected" is a little worrying, but could it or all failures, be false alarms? And if it's not, if this common/expected for such a small change? For first the first failing package:
|
No I don't believe this is backportable. So far I see two packages failing GC corruption is probably intermittent; my guess is it's just luck that it happened here, but I'll look into it of course in case it's a different bug in julia or that package. The |
Ok, searching the full logs there are new inference tests failing in: There are inference tests failing that also fail without this PR in: |
Added some mitigations. Here's the analysis:
|
@rfourquet Is the type declaration in Random valid? |
Yes, fortunately |
@nanosoldier |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan |
This improves, I see e.g. 0.43 but also down to 41.24 times slower (are some of these false?); |
Unsurprisingly, the big regressions are in union-splitting cases that involve 4 cases ( |
@nanosoldier |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, those results seem good. I think it should be split into 3ish commits though.
base/compiler/typelimits.jl
Outdated
uw = unwrap_unionall(wr) | ||
ui = unwrap_unionall(ti) | ||
uj = unwrap_unionall(tj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uw = unwrap_unionall(wr) | |
ui = unwrap_unionall(ti) | |
uj = unwrap_unionall(tj) | |
uw = unwrap_unionall(wr)::DataType | |
ui = unwrap_unionall(ti)::DataType | |
uj = unwrap_unionall(tj)::DataType |
merged = merged{uw.parameters[k]} | ||
end | ||
end | ||
widen = rewrap_unionall(merged, wr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this is entirely sound, due mainly to losing where
bounds, but also wondering if it'd mismatch TypeVars coming from different places. What if we had something like:
struct MyType{A, B, C, D} end
T = TypeVar(:T)
S = TypeVar(:S)
A = UnionAll(T, MyType{T, S, T, Pair{T, S}})
B = UnionAll(T, MyType{S, T, T, Pair{T, S}})
The merge result would appear to be:
MyType{A, B, T, Pair{T, S}} where B where A
Which, I think the only issue it has is that it's missing where T
, but just checking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I'll exclude anything with free typevars.
See JuliaLang/julia#36208 For some reason, the type returned by ManyPencilArray is correctly inferred when `length.(stuff)` is replaced by `map(length, stuff)` in `size_local()`. Using `broadcast` instead of `map` also works, which is surprising given that the dot syntax should be equivalent to broadcast.
For what it's worth, the PencilFFTs inference issue is fixed by replacing a broadcast over a tuple using the dot syntax, by an explicit broadcast using Maybe this can help the mitigation effort. I can also try to provide a simpler example that reproduces the issue. |
Bisection revealed that this PR is reponsible for the fact that the return type of Do you think something can be done about this? FWIW, I've noticed that in |
Until we settle on a generally-better algorithm (which may not exist), this is a good way to get some free performance. I'm curious to find out what PkgEval says.
Here are some numbers. Baseline from master (note my environment also includes JuliaPlots/PlotUtils.jl#96):
This PR:
The last item is clearly volatile; there are probably just a few critical backedges that this plus #36200 manage to cut.