-
-
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
Inference regression in 1.11 #55230
Comments
Doing the very scientific thing of Ctrl-C after some time it seems to be stuck in subtyping:
|
I think
is a reproducer |
For me, ClimaAtmos precompiles for a very long time on 1.10 though so I cannot really check if this subtype check is fast there... |
Ah yeah, interesting! I just tried your reproducer on 1.10.4 and found that indeed the subtype check is slow there too. However, if you look at our CI, you'll see that we can run without problems on 1.10.4 but not on 1.11-rc1. This still reproduces the problem, so there's probably something else going on.
For 1.10.4: |
Not sure, locally on my M1 it was precompiling for ever but seems to work ok when SSHing to a different system.
Okay, might be some other change that causes this subtyping query to take place on 1.11 but not on 1.10 then. |
This comment was marked as outdated.
This comment was marked as outdated.
cc @vtjnash |
That's unfortunate. Hopefully the subtyping precision improvements are savable |
The subtyping query in #55230 (comment) could perhaps be made faster? |
With no packages julia> T1 = Tuple{Union{Val{1}, Val{2}, Val{3}, Val{4}, Nothing},
Union{Val{1}, Val{2}, Val{3}, Nothing},
Union{Val{1}, Val{2}, Val{3}, Nothing},
Union{Val{1}, Val{2}, Val{3}, Nothing},
Union{Val{1}, Nothing},
Union{Val{1}, Nothing},
Union{Nothing, Val{1}},
Union{Val{1}, Val{2}, Val{3}, Val{4}, Val{5}, Val{6}, Val{7}, Nothing},
Union{Val{1}, Val{2}, Nothing},
Union{Val{1}, Val{2}, Nothing},
Union{Val{1}, Val{2}, Nothing},
Any,
Union{Val{1}, Val{2}, Val{3}, Nothing},
Union{Val{1}, Val{2}, Val{3}, Val{4}},
Union{Val{1}, Val{2}, Val{3}, Val{4}, Val{5}},
Any,
Any,
Any,
Any,
Union{Val{1}, Val{2}, Nothing},
Union{Val{1}, Val{2}, Nothing},
Union{Val{1}, Val{2}, Nothing},
Union{Val{1}, Val{2}, Nothing},
Union{Val{1}, Val{2}, Nothing},
Union{Val{1}, Val{2}},
Union{Val{1}, Val{2}},
Union{Val{1}, Val{2}, Nothing},
Union{Val{1}, Val{2}, Nothing},
Union{Val{1}, Val{2}, Val{3}, Nothing},
Union{Val{1}, Val{2}, Val{3}, Nothing},
Union{Val{1}, Val{2}},
Union{Val{1}, Val{2}, Val{3}},
Val{1}}
julia> T2 = Tuple{MC, MM, PM, CM, CCDPS, F, S, RM, LA, EXTFORCING, EC, AT, TM, EEM, EDM, ESMF, ESDF, ENP, EVR, TCM, NOGW, OGW, HD, VD, DM, SAM, VS, RS, ST, IN, SM, SA, NUM} where NUM where SA where SM where IN where ST where RS where VS where SAM where DM where VD where HD where OGW where NOGW where TCM where EVR where ENP where ESDF where ESMF where EDM where EEM where TM where AT where EC where EXTFORCING where LA where RM where S where F where CCDPS where CM where PM where MM where MC
@time T1 <: T2 |
somewhat more simplified:
|
Much simpler:
|
We are seeing massive latency increases in
ClimaAtmos.jl
with Julia 1.11, starting from the alphas and continuing in 1.11-rc1 (CliMA/ClimaAtmos.jl#3186).ClimaAtmos.jl
does no longer compile in any reasonable time with Julia 1.11-rc1. I identified that the offending function isget_atmos
, a simple function that returns a keyword-defined type. For the most part, this function simply converts string keywords read from YAML files to types, then, it returns aAtmosModel
(defined below).I used
SnoopCompile
(master
) to try to get a little more insight. Theget_atmos
function, as it is, takes too long to compile (on Julia 1.10, this is instantaneous), so I had to remove part of it (as mentioned in the referenced issue). Once I do so, I see with@snoop_inference
that:Plotting the inference:
All the time is spent in
types.jl
line 329. This line simply defines our struct:I have not tried without keyword arguments.
I don't think that what we are doing up to this point is particularly complex or unorthodox, and most of the types involved are very simple (mostly singletons and bools, all immutable).
Originally posted by @Sbozzolo in #55171 (comment)
The text was updated successfully, but these errors were encountered: