-
Notifications
You must be signed in to change notification settings - Fork 35
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
bad inferrability is back on recent Julia master #45
Comments
Don't have time to do a full bisect atm but:
|
Okay, I tracked this down to JuliaLang/julia@88f1712. What that means is essentially that JuliaLang/julia#26981 was incomplete; I'm guessing that the SparseArray tests that were broken in that PR should've been passing as well. From the MWE here, it's likely that the port of the varargs optimization over to the new optimizer is not hitting the InferenceResult cache correctly. I'll try to get a PR going to fix that (and hopefully speed up some Base code as well). |
So this is getting hard to debug without a fix for #47, so I'll tackle that first. As a reminder to myself, I can debug the cache by doing using Cassette
Cassette.@context Ctx
f() = Cassette.recurse(Ctx(), unsafe_load, pointer(Float32[]))
p = Core.Compiler.Params(typemax(UInt))
Core.Compiler.typeinf_type(methods(f).ms[1], Tuple{typeof(f)}, Core.svec(), p) # now p.cache should be populated and introspectable Also as a reminder to myself, here are some examples of the new optimizer's atypes transform for varargs methods before hitting the cache: OLD atypes: Array{Any, (4,)}[
Core.Compiler.Const(val=typeof(Core._apply)(), actual=false),
Core.Compiler.Const(val=typeof(Base._maybe_reshape)(), actual=false),
Tuple{Base.IndexLinear, Base.BitArray{2}},
Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}]
NEW atypes: Array{Any, (5,)}[
Core.Compiler.Const(val=typeof(Base._maybe_reshape)(), actual=false),
Core.Compiler.Const(val=Base.IndexLinear(), actual=false),
Base.BitArray{2},
Base.Slice{Base.OneTo{Int64}},
Int64]
OLD atypes: Array{Any, (3,)}[
Core.Compiler.Const(val=typeof(Core._apply)(), actual=false),
Core.Compiler.Const(val=typeof(Base.index_lengths)(), actual=false),
Tuple{Int64}]
NEW atypes: Array{Any, (2,)}[
Core.Compiler.Const(val=typeof(Base.index_lengths)(), actual=false),
Int64] |
Okay, from the example above, we can get:
So it looks like the At the very least, it looks like
|
closed by JuliaLang/julia#28079 |
Here
%19
should be inferred as a Float32, but isn't. It doesn't necessarily matter in this case since we inferred the output anyway, but in other cases this seems like an indicator that something broke.The text was updated successfully, but these errors were encountered: