-
-
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
[release-0.6] help #24383 inference and load time regression #24399
Conversation
880ca90
to
2b4cb95
Compare
Yeah, that looks fine. In my analysis of all packages on my system, this list had ~10-1000 items originally (edit: usually around 10 originally, and now usually in the low hundreds), so I didn't worry about optimizing it (and the assertion there was pretty helpful in shaking out latent problems that it used to have). The change to the union-splitting logic seems less advisable though (it's covering for subtyping returning incorrect type variable bounds, leading to incorrect eltype deductions), but also valid. |
I'll work on that. We should really make sure the inferred static parameter values are sound no matter what. |
c3f5f5f
to
931b322
Compare
Ok, I think this might be good now. I would say a PkgEval run is warranted however. |
if (!oldval || !jl_is_typevar(oldval) || !jl_is_long(val)) | ||
if (oldval && !jl_egal(oldval, val)) | ||
e->envout[e->envidx] = (jl_value_t*)u->var; | ||
else |
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.
this commit should probably be put on master first
let T1 = Array{Float64}, T2 = Array{_1,2} where _1 | ||
inference_test_copy(a::T) where {T<:Array} = ccall(:jl_array_copy, Ref{T}, (Any,), a) | ||
rt = Base.return_types(inference_test_copy, (Union{T1,T2},))[1] | ||
@test rt >: T1 && rt >: T2 |
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.
This should be testing for equality to something. I know you only want to test for strongly valid properties, but as written, I can't verify that this test is testing for the reported issue. And it could also break again later without noticing that this test was later rendered ineffectual.
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.
The brokenness before was that rt >: T1 && rt >: T2
did not hold. So if it broke again the test would fail.
…g of large precompiled packages. extracted from #24399
Would be great if @ChrisRackauckas can try this out. |
I don't have the setup to build everything right now, but my test would be to just check |
Bump @JeffBezanson. It would be great if we could get this merged so that it can go into 0.6.2. |
reduce O(n^2) behavior of `jl_recache_types` improve soundness of inferred typevar bounds in subtyping these help #24383
931b322
to
9e84757
Compare
Rebased. Merge when ready if the test failures are expected. |
Yep, they are. The release-0.6 branch doesn't have the CircleCI configuration file, any of the commits that got Julia building on FreeBSD, or the fixes for Travis that allow IPv6. (The Travis change is being backported.) Thanks Jeff! |
This appears to have broken JuliaDB (based on a |
How can I get more info on the failure? |
Build the release-0.6 branch and run |
If this works, a similar version is applicable to master.
This change has two parts. First, I modified the union-splitting logic in method lookup to only infer split signatures that are concrete. This prunes a bunch of the inference tree, reducing BandedMatrices.ji from ~100MB to ~40MB.
Next there is a load time problem where
jl_recache_types
is O(n^2). (A lot of time is also spent inserting methods and backedges, but if thejl_recache_types
change works it's an easy fix.) @vtjnash will have to review to see if this is valid. If it's not, it can be dropped from the patch and there's still a significant improvement.With this,
using BandedMatrices
(including precompilation) takes ~3 minutes for me instead of ~20.ref #24383