-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
22 seconds to 3 and now more: Let's fix all of the DifferentialEquations.jl + universe compile times! #786
Comments
Would moving dependencies over to say ExprTools.jl be helpful? I've known since SciML/MuladdMacro.jl#9 that MacroTools.jl can have some pretty major performance issues, so I've been curious if it's worth the engineering effort to move away from it at a larger scale. @oxinabox ? |
I don't really know, I'm not a big user of such packages (I tend to "roll my own" when I need stuff like that). I think I pretty much have the invalidations fixed wrt to OrdinaryDiffEq (i.e., the ones you didn't take care of on your own), so I am starting to look at DifferentialEquations. The good news is that there appear to be only two substantive problems:
|
ExprTools should be preferred for things that it can do. For prewalk and post-walk those are super easy to define. For pattern matching on Expr, maybe use MLStyle.jl? |
Tada! julia> using DifferentialEquations, SnoopCompile
julia> function lorenz(du,u,p,t)
du[1] = 10.0(u[2]-u[1])
du[2] = u[1]*(28.0-u[3]) - u[2]
du[3] = u[1]*u[2] - (8/3)*u[3]
end
lorenz (generic function with 1 method)
julia> u0 = [1.0;0.0;0.0]
3-element Vector{Float64}:
1.0
0.0
0.0
julia> tspan = (0.0,100.0)
(0.0, 100.0)
julia> prob = ODEProblem(lorenz,u0,tspan)
ODEProblem with uType Vector{Float64} and tType Float64. In-place: true
timespan: (0.0, 100.0)
u0: 3-element Vector{Float64}:
1.0
0.0
0.0
julia> alg = Tsit5()
Tsit5()
julia> tinf = @snoopi_deep solve(prob,alg)
InferenceTimingNode: 1.061332/1.436110 on Core.Compiler.Timings.ROOT() with 1 direct children It involves a lot of custom stuff:
This is a bespoke build of Julia 1.8 (with several of my pending PRs) and tweaks to quite a few packages, including deleting the problematic Unitful method mentioned in #786 (comment). I'll see about trying to get the rest of this out there and merged to master, Interestingly, this does not solve the CPUSummary issue, and yet I'm still getting great compile times. So we can afford to keep looking at this issue. CC @chriselrod. |
well, well, 👏 👏 I'm impressed haha. |
I can get this using the released versions of packages too, with the exceptions listed in #786 (comment) and the change to Unitful. I think the really big ones are (1) the We'll want to test 1.7 soon and see if you're still able to get good compile times, and if not possibly backport the essential PRs. |
SciML/ModelingToolkit.jl#1215 highlights a parallel issue that once the symbolic tools get involved, there's a whole extra can of worms to consider. But that might have to wait until a later day. |
Does inference/compilation times reported here include the time it takes to run |
No, not the using time, but the using time is relatively unchanged. |
With: SciML/OrdinaryDiffEq.jl#1535 Passing a chunk size is now down to 2 inference triggers total on static array code, both of which are a bit confusing. using DifferentialEquations, SnoopCompile
function lorenz(du,u,p,t)
du[1] = 10.0(u[2]-u[1])
du[2] = u[1]*(28.0-u[3]) - u[2]
du[3] = u[1]*u[2] - (8/3)*u[3]
end
u0 = [1.0;0.0;0.0]
tspan = (0.0,100.0)
prob = ODEProblem(lorenz,u0,tspan)
alg = Rodas5(chunk_size = Val{3}())
tinf = @snoopi_deep solve(prob,alg)
solve(prob,alg) julia> itrigs = inference_triggers(tinf)
2-element Vector{InferenceTrigger}:
Inference triggered to call setindex!(::Vector{Tuple{Float64, Float64, Float64}}, ::Tuple{Bool, Bool, Bool}, ::Int64) from generate_chunked_partials (C:\Users\accou\.julia\dev\SparseDiffTools\src\differentiation\compute_jacobian_ad.jl:75) with specialization SparseDiffTools.generate_chunked_partials(::Vector{Float64}, ::UnitRange{Int64}, ::Val{3})
Inference triggered to call OrdinaryDiffEq.jacobian2W!(::Matrix{Float64}, ::LinearAlgebra.UniformScaling{Bool}, ::Float64, ::Matrix{Float64}, ::Bool) called from toplevel That's from what used to be 46 inference spots, now there should just be 0 or 1 depending on if the chunk size is passed. Could constant prop fix chunk size inference? |
JuliaLang/julia#43370 is a Julia Base PR that fixes #785 and halves the FTTP |
#785 was solved by removing an invalidation in Symbolics: JuliaSymbolics/Symbolics.jl#471 . 🎉 Now |
ForwardDiff compile time test problem: using OrdinaryDiffEq, SnoopCompile, ForwardDiff
function lotka_volterra!(du, u, p, t)
x, y = u
α, β, δ, γ = p
du[1] = dx = α*x - β*x*y
du[2] = dy = -δ*y + γ*x*y
end
# Initial condition
u0 = [1.0, 1.0]
# Simulation interval and intermediary points
tspan = (0.0, 10.0)
tsteps = 0.0:0.1:10.0
# LV equation parameter. p = [α, β, δ, γ]
p = [1.5, 1.0, 3.0, 1.0]
# Setup the ODE problem, then solve
prob = ODEProblem(lotka_volterra!, u0, tspan, p)
sol = solve(prob, Tsit5())
function loss(p)
sol = solve(prob, Tsit5(), p=p, saveat = tsteps)
sum(abs2, sol.-1)
end
tinf = @snoopi_deep ForwardDiff.gradient(loss,p)
using ProfileView
ProfileView.view(flamegraph(tinf)) A lot of this is from ForwardDiff not caching some compiles. @chriselrod let's take a look at that. |
As discussed on slack, tagging is likely part of the problem. A solution I'd suggest is defining a method for some entry point functions like Basically, add a Perhaps it is best to only support |
That would go in the high level solve.jl in DiffEqBase.jl For the internal duals, let's make an option in algorithms to use standardtag=true by default, and then just use |
Forward mode AD is a lot faster now: SciML/DiffEqBase.jl#722 using OrdinaryDiffEq, SnoopCompile, ForwardDiff
lorenz = (du,u,p,t) -> begin
du[1] = 10.0(u[2]-u[1])
du[2] = u[1]*(28.0-u[3]) - u[2]
du[3] = u[1]*u[2] - (8/3)*u[3]
end
u0 = [1.0;0.0;0.0]; tspan = (0.0,100.0);
prob = ODEProblem(lorenz,u0,tspan); alg = Rodas5();
tinf = @snoopi_deep ForwardDiff.gradient(u0 -> sum(solve(ODEProblem(lorenz,u0,tspan),alg)), u0)
tinf = @snoopi_deep ForwardDiff.gradient(u0 -> sum(solve(ODEProblem(lorenz,u0,tspan),alg)), u0) Before: #First
InferenceTimingNode: 1.849625/14.538148 on Core.Compiler.Timings.ROOT() with 32 direct children
#Second
InferenceTimingNode: 1.531660/4.170409 on Core.Compiler.Timings.ROOT() with 12 direct children After: #First
InferenceTimingNode: 1.181086/3.320321 on Core.Compiler.Timings.ROOT() with 32 direct children
#Second
InferenceTimingNode: 0.998814/1.650488 on Core.Compiler.Timings.ROOT() with 11 direct children |
@timholy is going to beat all of us in this compile time race by attempting JuliaLang/julia#42016 |
Chunked out some invalidations: SciML/DiffEqBase.jl#723 and the CLIMA folks are happy CliMA/TurbulenceConvection.jl#673. @timholy is there an easy way to figure out which invalidations you should prioritize? |
I took some hints from @charleskawczynski and went invalidation hunting: # From: https://timholy.github.io/SnoopCompile.jl/stable/snoopr/
using SnoopCompile
invalidations = @snoopr begin
using DifferentialEquations
function lorenz(du,u,p,t)
du[1] = 10.0(u[2]-u[1])
du[2] = u[1]*(28.0-u[3]) - u[2]
du[3] = u[1]*u[2] - (8/3)*u[3]
end
u0 = [1.0;0.0;0.0]
tspan = (0.0,100.0)
prob = ODEProblem(lorenz,u0,tspan)
alg = Rodas5()
tinf = solve(prob,alg)
end;
trees = SnoopCompile.invalidation_trees(invalidations);
@show length(SnoopCompile.uinvalidated(invalidations)) # show total invalidations
show(trees[end]) # show the most invalidated method
# Count number of children (number of invalidations per invalidated method)
n_invalidations = map(trees) do methinvs
SnoopCompile.countchildren(methinvs)
end
import Plots
Plots.plot(
1:length(trees),
n_invalidations;
markershape = :circle,
xlabel = "i-th method invalidation",
label = "Number of children per method invalidations",
) Resulting in downstream PRs to remove all of the largest offenders:
Except for JuliaFolds/InitialValues.jl#63, the last of which I'll want @tkf's help figuring out. The PRs handle the top 3 at least, so that entire spike should be deleted. Edit: JuliaFolds/InitialValues.jl#64 joined the fray |
This is the current compile time benchmarks: using DifferentialEquations, SnoopCompile
function lorenz(du,u,p,t)
du[1] = 10.0(u[2]-u[1])
du[2] = u[1]*(28.0-u[3]) - u[2]
du[3] = u[1]*u[2] - (8/3)*u[3]
end
u0 = [1.0;0.0;0.0]
tspan = (0.0,100.0)
prob = ODEProblem(lorenz,u0,tspan)
alg = Tsit5()
tinf = @snoopi_deep solve(prob,alg)
#InferenceTimingNode: 0.753838/1.076605 on Core.Compiler.Timings.ROOT() with 1 direct children
# New Session
alg = Rodas5(chunk_size = Val{3}(),linsolve = DifferentialEquations.OrdinaryDiffEq.RFLUFactorization())
#InferenceTimingNode: 1.069709/1.983534 on Core.Compiler.Timings.ROOT() with 7 direct children
# New Session
using OrdinaryDiffEq, SnoopCompile, ForwardDiff
lorenz = (du,u,p,t) -> begin
du[1] = 10.0(u[2]-u[1])
du[2] = u[1]*(28.0-u[3]) - u[2]
du[3] = u[1]*u[2] - (8/3)*u[3]
end
u0 = [1.0;0.0;0.0]; tspan = (0.0,100.0);
prob = ODEProblem(lorenz,u0,tspan); alg = Rodas5();
tinf = @snoopi_deep ForwardDiff.gradient(u0 -> sum(solve(ODEProblem(lorenz,u0,tspan),alg)), u0)
tinf = @snoopi_deep ForwardDiff.gradient(u0 -> sum(solve(ODEProblem(lorenz,u0,tspan),alg)), u0)
# First: InferenceTimingNode: 1.233956/3.789888 on Core.Compiler.Timings.ROOT() with 35 direct children
# Second: InferenceTimingNode: 1.023062/1.785363 on Core.Compiler.Timings.ROOT() with 15 direct children |
Now looking at using times, #835 chunked that down. I then started hunting downstream libraries with big Requires:
While trying to track down using times I noticed I was missing some tooling. @timholy do you know of a way to make the profiler tell you which package is using Requires.jl time? https://discourse.julialang.org/t/profiling-requires-jl/73570 The profiler says that most of the remaining time is in Requires.jl, but I can't figure out where. So I commented out the Requires.jl usage in Polyester, LoopVectorization, ArrayInterface, and DiffEqBase. Adding DiffEqBase and ArrayInterface to the list had zero change from just Polyester and LoopVectorization, which means the SciML libraries are not the Requires.jl users that are the trouble, and surprisingly neither is ArrayInterface.jl. I then looked at with and without a custom system image: using PackageCompiler
create_sysimage(["StaticArrays","ForwardDiff"],sysimage_path="sysimage2.so") and saw: # Before PR
julia> @time using DifferentialEquations
8.694322 seconds (24.77 M allocations: 1.736 GiB, 7.27% gc time, 17.92% compilation time)
# After PR
julia> @time using DifferentialEquations
5.761738 seconds (18.00 M allocations: 1.327 GiB, 4.54% gc time, 10.38% compilation time)
# After PR + sysimage
julia> @time using DifferentialEquations
4.565475 seconds (14.80 M allocations: 1.108 GiB, 6.05% gc time, 8.73% compilation time) That lead to this Discourse thread on what to do about ForwardDiff and StaticArrays.jl contributing about one second of this time. The mysterious other 4.5 seconds in Requires.jl time is still elusive though... I need a Requires profiler! |
Package load times have improved dramatically by doing ArrayInterfaceCore, and now GPUArraysCore. ArrayInterface changes was about 1 second off everything. Now GPUArrays is another second off. Numbers: Before: julia> @time_imports using RecursiveArrayTools julia> @time_imports using RecursiveArrayTools After: julia> @time_imports using RecursiveArrayTools julia> @time_imports using RecursiveArrayTools @time_imports using OrdinaryDiffEq Before: 11.2 ms ┌ MacroTools After: SciML/RecursiveArrayTools.jl#213 @time_imports using OrdinaryDiffEq 10.4 ms ┌ MacroTools |
Current invalidations report: using SnoopCompile
invalidations = @snoopr begin
using OrdinaryDiffEq
function lorenz(du, u, p, t)
du[1] = 10.0(u[2] - u[1])
du[2] = u[1] * (28.0 - u[3]) - u[2]
du[3] = u[1] * u[2] - (8 / 3) * u[3]
end
u0 = [1.0; 0.0; 0.0]
tspan = (0.0, 100.0)
prob = ODEProblem{true,false}(lorenz, u0, tspan)
alg = Rodas5()
tinf = solve(prob, alg)
end;
trees = SnoopCompile.invalidation_trees(invalidations);
@show length(SnoopCompile.uinvalidated(invalidations)) # show total invalidations
show(trees[end]) # show the most invalidated method
# Count number of children (number of invalidations per invalidated method)
n_invalidations = map(trees) do methinvs
SnoopCompile.countchildren(methinvs)
end
import Plots
Plots.plot(
1:length(trees),
n_invalidations;
markershape=:circle,
xlabel="i-th method invalidation",
label="Number of children per method invalidations"
) julia> show(trees[end])
inserting convert(::Type{DAEFunction}, f) in SciMLBase at C:\Users\accou\.julia\packages\SciMLBase\3fOCs\src\scimlfunctions.jl:3227 invalidated:
mt_backedges: 1: signature Tuple{typeof(convert), Type{F} where F<:Function, Function} triggered MethodInstance for error(::String, ::Expr) (0 children)
2: signature Tuple{typeof(convert), Type{F} where F<:Function, Function} triggered MethodInstance for FileIO.querysym_all(::IOStream) (0 children)
3: signature Tuple{typeof(convert), Type{F} where F<:Function, Function} triggered MethodInstance for JuliaInterpreter.compute_ssa_mapping_delete_statements!(::Core.CodeInfo, ::Vector{Int64}) (0 children)
4: signature Tuple{typeof(convert), Type{F} where F<:Function, Function} triggered MethodInstance for LoweredCodeUtils.step_through_methoddef(::Any, ::JuliaInterpreter.Frame, ::Any) (0 children)
5: signature Tuple{typeof(convert), Type{F} where F<:Function, Function} triggered MethodInstance for SnoopCompile._show(::IOContext{IOBuffer}, ::SnoopCompileCore.InferenceTiming) (0 children)
6: signature Tuple{typeof(convert), Type{F} where F<:Function, Function} triggered MethodInstance for Base.mapreduce_empty_iter(::Function, ::Function, ::Vector{Expr}, ::Base.HasEltype) (0 children)
7: signature Tuple{typeof(convert), Type{F} where F<:Function, Function} triggered MethodInstance for Base.MappingRF(::typeof(identity), ::Function) (1 children)
8: signature Tuple{typeof(convert), Type{F} where F<:Function, Function} triggered MethodInstance for Base.MappingRF(::Function, ::typeof(min)) (2 children)
9: signature Tuple{typeof(convert), Type{F} where F<:Function, Function} triggered MethodInstance for Base.MappingRF(::Function, ::typeof(max)) (6 children)
10: signature Tuple{typeof(convert), Type{F} where F<:Function, Function} triggered MethodInstance for Base.MappingRF(::Function, ::typeof(Base.add_sum)) (6 children)
11: signature Tuple{typeof(convert), Type{F} where F<:Function, Function} triggered MethodInstance for Base.MappingRF(::Function, ::typeof(|)) (22 children)
12: signature Tuple{typeof(convert), Type{F} where F<:Function, Function} triggered MethodInstance for Base.MappingRF(::Function, ::typeof(&)) (24 children)
13: signature Tuple{typeof(convert), Type{F} where F<:Function, Function} triggered MethodInstance for Base.MappingRF(::Function, ::Function) (1704 children)
14: signature convert(::Type{T}, x::T) where T in Base at Base.jl:61 (formerly convert(::Type{T}, x::T) where T in Base at Base.jl:61) triggered MethodInstance for Base.print_to_string(::Symbol, ::String, ::Expr, ::String) (1 children)
15: signature convert(::Type{T}, x::T) where T in Base at Base.jl:61 (formerly convert(::Type{T}, x::T) where T in Base at Base.jl:61) triggered MethodInstance for KrylovKit._set_num_threads_warn(::Int64) (1 children)
backedges: 1: superseding convert(::Type{T}, x::T) where T in Base at Base.jl:61 with MethodInstance for convert(::Type{T}, ::T) where T<:Function (13 children)
1 mt_cache
false
julia> show(trees[end-1])
inserting !(::Static.False) in Static at C:\Users\accou\.julia\packages\Static\sVI3g\src\Static.jl:427 invalidated:
mt_backedges: 1: signature Tuple{typeof(!), Any} triggered MethodInstance for !=(::AbstractFloat, ::AbstractFloat) (0 children)
2: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.isbadzero(::typeof(min), ::AbstractFloat) (0 children)
3: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.CoreLogging.var"#handle_message#2"(::Base.Pairs{Symbol, V, Tuple{Vararg{Symbol, N}}, NamedTuple{names, T}} where {V, N, names, T<:Tuple{Vararg{Any, N}}}, ::typeof(Base.CoreLogging.handle_message), ::Base.CoreLogging.SimpleLogger, ::Base.CoreLogging.LogLevel, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) (0 children)
4: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.CoreLogging.var"#handle_message#2"(::Base.Pairs{Symbol, _A, Tuple{Symbol}, NamedTuple{names, T}} where {_A, names, T<:Tuple{Vararg{Any, N}}}, ::typeof(Base.CoreLogging.handle_message), ::Base.CoreLogging.SimpleLogger, ::Base.CoreLogging.LogLevel, ::LazyString, ::Any, ::Symbol, ::Any, ::Any, ::Any) (0 children)
5: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.CoreLogging.var"#handle_message#2"(::Base.Pairs{Symbol, _A, Tuple{Symbol}, NamedTuple{names, T}} where {_A, names, T<:Tuple{Vararg{Any, N}}}, ::typeof(Base.CoreLogging.handle_message), ::Base.CoreLogging.SimpleLogger, ::Base.CoreLogging.LogLevel, ::String, ::Any, ::Symbol, ::Any, ::Any, ::Any) (0 children)
6: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.CoreLogging.var"#handle_message#2"(::Base.Pairs{Symbol, _A, Tuple{Symbol}, NamedTuple{names, T}} where {_A, names, T<:Tuple{Vararg{Any, N}}}, ::typeof(Base.CoreLogging.handle_message), ::Base.CoreLogging.SimpleLogger, ::Base.CoreLogging.LogLevel, ::LazyString, ::Module, ::Symbol, ::Symbol, ::String, ::Int64) (0 children)
7: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.CoreLogging.var"#handle_message#2"(::Base.Pairs{Symbol, _A, Tuple{Symbol}, NamedTuple{names, T}} where {_A, names, T<:Tuple{Vararg{Any, N}}}, ::typeof(Base.CoreLogging.handle_message), ::Base.CoreLogging.SimpleLogger, ::Base.CoreLogging.LogLevel, ::String, ::Module, ::Symbol, ::Symbol, ::String, ::Int64) (0 children)
8: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.CoreLogging.var"#handle_message#2"(::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::typeof(Base.CoreLogging.handle_message), ::Base.CoreLogging.SimpleLogger, ::Base.CoreLogging.LogLevel, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) (0 children)
9: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.CoreLogging.var"#handle_message#2"(::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::typeof(Base.CoreLogging.handle_message), ::Base.CoreLogging.SimpleLogger, ::Base.CoreLogging.LogLevel, ::String, ::Module, ::Symbol, ::Symbol, ::String, ::Int64) (0 children)
10: signature Tuple{typeof(!), Any} triggered MethodInstance for !=(::Integer, ::Int64) (0 children)
11: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.CoreLogging.var"#handle_message#2"(::Base.Pairs{Symbol, _A, Tuple{Symbol, Symbol}, NamedTuple{names, T}} where {_A, names, T<:Tuple{Vararg{Any, N}}}, ::typeof(Base.CoreLogging.handle_message), ::Base.CoreLogging.SimpleLogger, ::Base.CoreLogging.LogLevel, ::String, ::Nothing, ::Any, ::Symbol, ::Nothing, ::Int64) (0 children)
12: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.CoreLogging.var"#handle_message#2"(::Base.Pairs{Symbol, Int64, Tuple{Symbol}, NamedTuple{(:maxlog,), Tuple{Int64}}}, ::typeof(Base.CoreLogging.handle_message), ::Base.CoreLogging.SimpleLogger, ::Base.CoreLogging.LogLevel, ::String, ::Module, ::Symbol, ::Symbol, ::String, ::Int64) (0 children)
13: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.CoreLogging.var"#handle_message#2"(::Base.Pairs{Symbol, Tuple{ErrorException, Vector{Union{Ptr{Nothing}, Base.InterpreterIP}}}, Tuple{Symbol}, NamedTuple{(:exception,), Tuple{Tuple{ErrorException, Vector{Union{Ptr{Nothing}, Base.InterpreterIP}}}}}}, ::typeof(Base.CoreLogging.handle_message), ::Base.CoreLogging.SimpleLogger, ::Base.CoreLogging.LogLevel, ::String, ::Module, ::Symbol, ::Symbol, ::String, ::Int64) (0 children)
14: signature Tuple{typeof(!), Any} triggered MethodInstance for (::Base.var"#96#97")(::Int64) (0 children)
15: signature Tuple{typeof(!), Any} triggered MethodInstance for (::Base.var"#96#97"{typeof(iszero)})(::Any) (0 children)
16: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Int64}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Perm{<:Base.Order.ReverseOrdering{Base.Order.ForwardOrdering}, <:Union{AbstractVector{Union{Missing, Float32}}, AbstractVector{Union{Missing, Float64}}, AbstractVector{Missing}, AbstractVector{Float32}, AbstractVector{Float64}}}) (0 children)
17: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Int64}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Perm{<:Base.Order.ForwardOrdering, <:Union{AbstractVector{Union{Missing, Float32}}, AbstractVector{Union{Missing, Float64}}, AbstractVector{Missing}, AbstractVector{Float32}, AbstractVector{Float64}}}) (0 children)
18: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Int64}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Perm{_A, Vector{Float64}} where _A<:Base.Order.Ordering) (0 children)
19: signature Tuple{typeof(!), Any} triggered MethodInstance for !=(::Any, ::Int64) (0 children)
20: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.CoreLogging.var"#handle_message#2"(::Base.Pairs{Symbol, Base.ExceptionStack, Tuple{Symbol}, NamedTuple{(:exception,), Tuple{Base.ExceptionStack}}}, ::typeof(Base.CoreLogging.handle_message), ::Base.CoreLogging.SimpleLogger, ::Base.CoreLogging.LogLevel, ::String, ::Module, ::Symbol, ::Symbol, ::String, ::Int64) (0 children)
21: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.CoreLogging.var"#handle_message#2"(::Base.Pairs{Symbol, ErrorException, Tuple{Symbol}, NamedTuple{(:exception,), Tuple{ErrorException}}}, ::typeof(Base.CoreLogging.handle_message), ::Base.CoreLogging.SimpleLogger, ::Base.CoreLogging.LogLevel, ::String, ::Module, ::Symbol, ::Symbol, ::String, ::Int64) (0 children)
22: signature Tuple{typeof(!), Any} triggered MethodInstance for Artifacts.process_overrides(::Dict{String, Any}, ::Base.UUID) (0 children)
23: signature Tuple{typeof(!), Any} triggered MethodInstance for Logging.var"#handle_message#3"(::Base.Pairs{Symbol, V, Tuple{Vararg{Symbol, N}}, NamedTuple{names, T}} where {V, N, names, T<:Tuple{Vararg{Any, N}}}, ::typeof(Base.CoreLogging.handle_message), ::Logging.ConsoleLogger, ::Base.CoreLogging.LogLevel, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) (0 children)
24: signature Tuple{typeof(!), Any} triggered MethodInstance for Logging.var"#handle_message#3"(::Base.Pairs{Symbol, _A, Tuple{Symbol}, NamedTuple{names, T}} where {_A, names, T<:Tuple{Vararg{Any, N}}}, ::typeof(Base.CoreLogging.handle_message), ::Logging.ConsoleLogger, ::Base.CoreLogging.LogLevel, ::LazyString, ::Any, ::Symbol, ::Any, ::Any, ::Any) (0 children)
25: signature Tuple{typeof(!), Any} triggered MethodInstance for Logging.var"#handle_message#3"(::Base.Pairs{Symbol, _A, Tuple{Symbol}, NamedTuple{names, T}} where {_A, names, T<:Tuple{Vararg{Any, N}}}, ::typeof(Base.CoreLogging.handle_message), ::Logging.ConsoleLogger, ::Base.CoreLogging.LogLevel, ::String, ::Any, ::Symbol, ::Any, ::Any, ::Any) (0 children)
26: signature Tuple{typeof(!), Any} triggered MethodInstance for Logging.var"#handle_message#3"(::Base.Pairs{Symbol, _A, Tuple{Symbol}, NamedTuple{names, T}} where {_A, names, T<:Tuple{Vararg{Any, N}}}, ::typeof(Base.CoreLogging.handle_message), ::Logging.ConsoleLogger, ::Base.CoreLogging.LogLevel, ::LazyString, ::Module, ::Symbol, ::Symbol, ::String, ::Int64) (0 children)
27: signature Tuple{typeof(!), Any} triggered MethodInstance for Logging.var"#handle_message#3"(::Base.Pairs{Symbol, _A, Tuple{Symbol}, NamedTuple{names, T}} where {_A, names, T<:Tuple{Vararg{Any, N}}}, ::typeof(Base.CoreLogging.handle_message), ::Logging.ConsoleLogger, ::Base.CoreLogging.LogLevel, ::String, ::Module, ::Symbol, ::Symbol, ::String, ::Int64) (0 children)
28: signature Tuple{typeof(!), Any} triggered MethodInstance for Logging.var"#handle_message#3"(::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::typeof(Base.CoreLogging.handle_message), ::Logging.ConsoleLogger, ::Base.CoreLogging.LogLevel, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) (0 children)
29: signature Tuple{typeof(!), Any} triggered MethodInstance for Logging.var"#handle_message#3"(::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::typeof(Base.CoreLogging.handle_message), ::Logging.ConsoleLogger, ::Base.CoreLogging.LogLevel, ::String, ::Module, ::Symbol, ::Symbol, ::String, ::Int64) (0 children)
30: signature Tuple{typeof(!), Any} triggered MethodInstance for Logging.var"#handle_message#3"(::Base.Pairs{Symbol, Base.ExceptionStack, Tuple{Symbol}, NamedTuple{(:exception,), Tuple{Base.ExceptionStack}}}, ::typeof(Base.CoreLogging.handle_message), ::Logging.ConsoleLogger, ::Base.CoreLogging.LogLevel, ::String, ::Module, ::Symbol, ::Symbol, ::String, ::Int64) (0 children)
31: signature Tuple{typeof(!), Any} triggered MethodInstance for Logging.var"#handle_message#3"(::Base.Pairs{Symbol, ErrorException, Tuple{Symbol}, NamedTuple{(:exception,), Tuple{ErrorException}}}, ::typeof(Base.CoreLogging.handle_message), ::Logging.ConsoleLogger, ::Base.CoreLogging.LogLevel, ::String, ::Module, ::Symbol, ::Symbol, ::String, ::Int64) (0 children)
32: signature Tuple{typeof(!), Any} triggered MethodInstance for Logging.var"#handle_message#3"(::Base.Pairs{Symbol, _A, Tuple{Symbol, Symbol}, NamedTuple{names, T}} where {_A, names, T<:Tuple{Vararg{Any, N}}}, ::typeof(Base.CoreLogging.handle_message), ::Logging.ConsoleLogger, ::Base.CoreLogging.LogLevel, ::String, ::Nothing, ::Any, ::Symbol, ::Nothing, ::Int64) (0 children)
33: signature Tuple{typeof(!), Any} triggered MethodInstance for REPL.LineEdit.var"#add_nested_key!#24"(::Any, ::typeof(REPL.LineEdit.add_nested_key!), ::Dict, ::Char, ::Any) (0 children)
34: signature Tuple{typeof(!), Any} triggered MethodInstance for REPL.LineEdit.getEntry(::Dict{Char, Any}, ::String) (0 children)
35: signature Tuple{typeof(!), Any} triggered MethodInstance for Pkg.LazilyInitializedFields.lazy_struct(::Expr) (0 children)
36: signature Tuple{typeof(!), Any} triggered MethodInstance for !=(::Any, ::Type{Float64}) (0 children)
37: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.at_disable_library_threading(::Function) (0 children)
38: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.at_disable_library_threading(::LinearAlgebra.var"#251#252") (0 children)
39: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.mightalias(::Vector, ::Vector{String}) (0 children)
40: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) (0 children)
41: signature Tuple{typeof(!), Any} triggered MethodInstance for !=(::Unsigned, ::Int64) (0 children)
42: signature Tuple{typeof(!), Any} triggered MethodInstance for showerror(::IOContext{Base.TTY}, ::MethodError) (0 children)
43: signature Tuple{typeof(!), Any} triggered MethodInstance for Pkg.Types.Manifest(::Dict{String, Any}, ::String) (0 children)
44: signature Tuple{typeof(!), Any} triggered MethodInstance for Tar.var"#read_tarball#47"(::Vector{UInt8}, ::Base.DevNull, ::typeof(Tar.read_tarball), ::Function, ::Function, ::Base.Process) (0 children)
45: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.var"#open#734"(::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::typeof(open), ::Pkg.Registry.var"#11#14"{IOBuffer, Vector{UInt8}, Dict{String, String}}, ::Cmd) (0 children)
46: signature Tuple{typeof(!), Any} triggered MethodInstance for Tar.var"#read_tarball#47"(::Vector{UInt8}, ::Base.DevNull, ::typeof(Tar.read_tarball), ::Tar.var"#26#28"{Vector{UInt8}, Bool, Bool, Base.Process, String}, ::Function, ::Base.Process) (0 children)
47: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.var"#open#734"(::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::typeof(open), ::Pkg.PlatformEngines.var"#26#28"{String}, ::Cmd) (0 children)
48: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.mightalias(::Vector, ::Vector{Pkg.Types.PackageSpec}) (0 children)
49: signature Tuple{typeof(!), Any} triggered MethodInstance for !=(::Any, ::Any) (0 children)
50: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Int64}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Perm{_A, Vector{Tuple{Float64, Float64}}} where _A<:Base.Order.Ordering) (0 children)
51: signature Tuple{typeof(!), Any} triggered MethodInstance for ∉(::Any, ::Any) (0 children)
52: signature Tuple{typeof(!), Any} triggered MethodInstance for ∉(::Base.UUID, ::Any) (0 children)
53: signature Tuple{typeof(!), Any} triggered MethodInstance for Pkg.Types.Manifest(::Dict{String, Any}, ::Base.DevNull) (0 children)
54: signature Tuple{typeof(!), Any} triggered MethodInstance for Pkg.Types.Manifest(::Dict{String, Any}, ::IOBuffer) (0 children)
55: signature Tuple{typeof(!), Any} triggered MethodInstance for !=(::Union{Nothing, Pkg.Types.UpgradeLevel, VersionNumber, String, Pkg.Versions.VersionSpec}, ::Union{Nothing, Pkg.Types.UpgradeLevel, VersionNumber, String, Pkg.Versions.VersionSpec}) (0 children)
56: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::AbstractVector{Union{Missing, Float32}}, ::Integer, ::Integer, ::Base.Sort.InsertionSortAlg, ::Base.Order.ForwardOrdering) (0 children)
57: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::AbstractVector{Union{Missing, Float64}}, ::Integer, ::Integer, ::Base.Sort.InsertionSortAlg, ::Base.Order.ForwardOrdering) (0 children)
58: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::AbstractVector{Missing}, ::Integer, ::Integer, ::Base.Sort.InsertionSortAlg, ::Base.Order.ForwardOrdering) (0 children)
59: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::AbstractVector{Float32}, ::Integer, ::Integer, ::Base.Sort.InsertionSortAlg, ::Base.Order.ForwardOrdering) (0 children)
60: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::AbstractVector{Float64}, ::Integer, ::Integer, ::Base.Sort.InsertionSortAlg, ::Base.Order.ForwardOrdering) (0 children)
61: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.Sort.var"#sort!#8"(::Base.Sort.Algorithm, ::typeof(isless), ::typeof(identity), ::Nothing, ::Base.Order.ForwardOrdering, ::typeof(sort!), ::AbstractVector) (0 children)
62: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.Sort.var"#sort!#8"(::Base.Sort.Algorithm, ::typeof(isless), ::typeof(identity), ::Nothing, ::Base.Order.ForwardOrdering, ::typeof(sort!), ::Vector) (0 children)
63: signature Tuple{typeof(!), Any} triggered MethodInstance for (::Pkg.API.var"#write_condensed_toml#182")(::Pkg.API.var"#153#184"{Set{String}}, ::Dict{String, Dict{String, Dates.DateTime}}, ::String) (0 children)
64: signature Tuple{typeof(!), Any} triggered MethodInstance for (::Pkg.API.var"#write_condensed_toml#182")(::Pkg.API.var"#156#187"{Set{String}}, ::Dict{String, Dict{String, Dates.DateTime}}, ::String) (0 children)
65: signature Tuple{typeof(!), Any} triggered MethodInstance for (::Base.var"#96#97")(::String) (0 children)
66: signature Tuple{typeof(!), Any} triggered MethodInstance for (::Pkg.API.var"#write_condensed_toml#182")(::Pkg.API.var"#159#190"{Dict{String, Dict{String, Set{String}}}, Set{String}, Set{String}}, ::Dict{String, Dict{String, Dates.DateTime}}, ::String) (0 children)
67: signature Tuple{typeof(!), Any} triggered MethodInstance for (::Base.var"#96#97")(::Base.PkgId) (0 children)
68: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.var"#open#734"(::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::typeof(open), ::Tar.var"#83#86"{Base.DevNull, Bool, _A, String} where _A, ::Cmd) (0 children)
69: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.var"#open#734"(::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::typeof(open), ::Tar.var"#83#86"{Base.DevNull, Bool, Tar.var"#1#2", String}, ::Cmd) (0 children)
70: signature Tuple{typeof(!), Any} triggered MethodInstance for !=(::Any, ::UInt8) (0 children)
71: signature Tuple{typeof(!), Any} triggered MethodInstance for ==(::Dict{String, Any}, ::Dict{String, Any}) (0 children)
72: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.mightalias(::Vector, ::Vector{Any}) (0 children)
73: signature Tuple{typeof(!), Any} triggered MethodInstance for Base._show_nonempty(::IOContext{Base.TTY}, ::AbstractMatrix, ::String, ::Bool, ::Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}) (0 children)
74: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Int64}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Perm{_A, Vector{Int64}} where _A<:Base.Order.Ordering) (0 children)
75: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Int64}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Perm{_A, Vector{Base.StackTraces.StackFrame}} where _A<:Base.Order.Ordering) (0 children)
76: signature Tuple{typeof(!), Any} triggered MethodInstance for Pkg.REPLMode._completions(::String, ::Bool, ::Int64, ::Int64) (0 children)
77: signature Tuple{typeof(!), Any} triggered MethodInstance for allunique(::AbstractRange) (0 children)
78: signature Tuple{typeof(!), Any} triggered MethodInstance for !=(::Any, ::Char) (0 children)
79: signature Tuple{typeof(!), Any} triggered MethodInstance for ∉(::GlobalRef, ::Any) (0 children)
80: signature Tuple{typeof(!), Any} triggered MethodInstance for Test.do_test_throws(::Test.ExecutionResult, ::Any, ::Any) (0 children)
81: signature Tuple{typeof(!), Any} triggered MethodInstance for Test.eval_test(::Expr, ::Expr, ::LineNumberNode, ::Bool) (0 children)
82: signature Tuple{typeof(!), Any} triggered MethodInstance for !=(::Any, ::Type{Float16}) (0 children)
83: signature Tuple{typeof(!), Any} triggered MethodInstance for !=(::Any, ::Type{Float32}) (0 children)
84: signature Tuple{typeof(!), Any} triggered MethodInstance for VSCodeServer.on_pkg_load(::Base.PkgId) (0 children)
85: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.Broadcast.preprocess(::Vector, ::Base.Broadcast.Broadcasted{Nothing, Tuple{Base.OneTo{Int64}}, _A, Tuple{Vector{Any}}} where _A) (0 children)
86: signature Tuple{typeof(!), Any} triggered MethodInstance for VSCodeServer.JuliaInterpreter.compute_ssa_mapping_delete_statements!(::Core.CodeInfo, ::Vector{Int64}) (0 children)
87: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.Broadcast.preprocess_args(::Vector, ::Tuple{Vector{Core.LineInfoNode}}) (0 children)
88: signature Tuple{typeof(!), Any} triggered MethodInstance for FileIO.__init__() (0 children)
89: signature Tuple{typeof(!), Any} triggered MethodInstance for FlameGraphs.var"#flamegraph!#8"(::Bool, ::Vector{Tuple{Symbol, Symbol}}, ::Int64, ::typeof(FlameGraphs.flamegraph!), ::LeftChildRightSiblingTrees.Node{FlameGraphs.NodeData}, ::Profile.StackFrameTree{Base.StackTraces.StackFrame}) (0 children)
90: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.Broadcast.preprocess(::Vector, ::Base.Broadcast.Broadcasted{Nothing, Tuple{Base.OneTo{Int64}}, _A, Tuple{Vector{Any}}} where _A) (0 children)
91: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.Broadcast.preprocess_args(::Vector, ::Tuple{Vector{Core.LineInfoNode}}) (0 children)
92: signature Tuple{typeof(!), Any} triggered MethodInstance for JuliaInterpreter.compute_ssa_mapping_delete_statements!(::Core.CodeInfo, ::Vector{Int64}) (0 children)
93: signature Tuple{typeof(!), Any} triggered MethodInstance for LoweredCodeUtils.step_through_methoddef(::Any, ::JuliaInterpreter.Frame, ::Any) (0 children)
94: signature Tuple{typeof(!), Any} triggered MethodInstance for SnoopCompile.__init__() (0 children)
95: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.Sort.var"#sortperm#12"(::Base.Sort.QuickSortAlg, ::Function, ::Function, ::Nothing, ::Base.Order.ForwardOrdering, ::typeof(sortperm), ::Vector{Float64}) (0 children)
96: signature Tuple{typeof(!), Any} triggered MethodInstance for StaticArrays.var"#s25#139"(::Any, ::Any, ::Any, ::Any) (0 children)
97: signature Tuple{typeof(!), Any} triggered MethodInstance for FiniteDiff.__init__() (0 children)
98: signature Tuple{typeof(!), Any} triggered MethodInstance for Artifacts.var"#artifact_meta#12"(::Base.BinaryPlatforms.Platform, ::typeof(Artifacts.artifact_meta), ::String, ::Dict{String, Any}, ::String) (0 children)
99: signature Tuple{typeof(!), Any} triggered MethodInstance for !=(::Int64, ::ForwardDiff.Dual{Ty}) where Ty (0 children)
100: signature Tuple{typeof(!), Any} triggered MethodInstance for MacroTools.match(::Expr, ::Symbol, ::Dict{Any, Any}) (0 children)
101: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.CoreLogging.log_record_id(::Any, ::Any, ::Any, ::Tuple{Any, Vararg{Any}}) (1 children)
102: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.CoreLogging.log_record_id(::Any, ::Any, ::Any, ::Tuple{}) (1 children)
103: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.isdelimited(::IOContext{IOBuffer}, ::Pair) (1 children)
104: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.Docs.moduledoc(::LineNumberNode, ::Module, ::Any, ::Any, ::Expr) (1 children)
105: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.Docs.moduledoc(::LineNumberNode, ::Module, ::Expr, ::Any, ::Expr) (1 children)
106: signature Tuple{typeof(!), Any} triggered MethodInstance for REPL.LineEdit.var"#add_nested_key!#24"(::Any, ::typeof(REPL.LineEdit.add_nested_key!), ::Dict, ::String, ::Any) (1 children)
107: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.BinaryPlatforms.platforms_match(::Base.BinaryPlatforms.AbstractPlatform, ::Base.BinaryPlatforms.AbstractPlatform) (1 children)
108: signature Tuple{typeof(!), Any} triggered MethodInstance for REPL.LineEditREPL(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) (1 children)
109: signature Tuple{typeof(!), Any} triggered MethodInstance for (::Pkg.REPLMode.var"#command_is_focused#53"{Bool, Int64})() (1 children)
110: signature Tuple{typeof(!), Any} triggered MethodInstance for VSCodeServer.add_code_to_repl_history(::String) (1 children)
111: signature Tuple{typeof(!), Any} triggered MethodInstance for Artifacts.process_overrides(::Dict{String, Any}, ::Base.UUID) (1 children)
112: signature Tuple{typeof(!), Any} triggered MethodInstance for !=(::Int64, ::Any) (2 children)
113: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict, ::Dict{Char, Any}, ::Any) (2 children)
114: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict{String, Function}, ::Any, ::Any) (2 children)
115: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict{String, Vector{Dict}}, ::Vector, ::Any) (2 children)
116: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict{String, Vector{String}}, ::Vector{String}, ::Any) (2 children)
117: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict{String, Base.UUID}, ::Base.UUID, ::Any) (2 children)
118: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict{String, Pkg.Types.Compat}, ::Any, ::Any) (2 children)
119: signature Tuple{typeof(!), Any} triggered MethodInstance for REPL._trimdocs(::Markdown.MD, ::Bool) (2 children)
120: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.var"#open#734"(::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::typeof(open), ::Function, ::Cmd) (3 children)
121: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict, ::Vector{String}, ::Any) (3 children)
122: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict, ::Dict{String, String}, ::Any) (3 children)
123: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict, ::Nothing, ::Any) (3 children)
124: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.CoreLogging.log_record_id(::Any, ::Any, ::Any, ::Any) (4 children)
125: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Symbol}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (4 children)
126: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Core.SimpleVector}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (4 children)
127: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.isdelimited(::IOContext{IOBuffer}, ::Pair{Symbol, Any}) (4 children)
128: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict{String, Union{Bool, String}}, ::Any, ::Any) (4 children)
129: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict{String, Union{Nothing, String}}, ::Any, ::Any) (4 children)
130: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Pkg.Versions.VersionRange}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (4 children)
131: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Pair{String, Pkg.REPLMode.CommandSpec}}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (4 children)
132: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Any}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (4 children)
133: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict{String, Vector{Pkg.Types.Stage1}}, ::Vector{Pkg.Types.Stage1}, ::Any) (4 children)
134: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Pair{String, String}}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (4 children)
135: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Base.UUID}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (4 children)
136: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Pair{String, Vector{Base.UUID}}}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (4 children)
137: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{VersionNumber}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (4 children)
138: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Base.BinaryPlatforms.AbstractPlatform}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (4 children)
139: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Set{Int64}}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (4 children)
140: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Union{Nothing, Pkg.Resolve.ResolveLogEntry}}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (4 children)
141: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Pair{String, Base.UUID}}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (4 children)
142: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Pair{String, Pkg.Types.Compat}}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (4 children)
143: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Tuple{Union{Nothing, Base.UUID}, Union{Nothing, Pkg.Types.PackageSpec}, Union{Nothing, Pkg.Types.PackageSpec}}}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (4 children)
144: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Tuple{Base.UUID, String, String, VersionNumber}}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (4 children)
145: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict, ::Dates.DateTime, ::Any) (4 children)
146: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Base.BinaryPlatforms.Platform}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (4 children)
147: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{REPL.REPLCompletions.Completion}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (4 children)
148: signature Tuple{typeof(!), Any} triggered MethodInstance for MacroTools.store!(::Dict{Any, Any}, ::Symbol, ::Expr) (4 children)
149: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Union{Int64, Symbol}}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (5 children)
150: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.BinaryPlatforms.platforms_match(::Base.BinaryPlatforms.Platform, ::Base.BinaryPlatforms.Platform) (5 children)
151: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{String}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.By{_A, Base.Order.ForwardOrdering} where _A) (5 children)
152: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict, ::VersionNumber, ::Any) (5 children)
153: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict, ::Base.SHA1, ::Any) (5 children)
154: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict, ::Bool, ::Any) (5 children)
155: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict{String, Nothing}, ::Nothing, ::Any) (6 children)
156: signature Tuple{typeof(!), Any} triggered MethodInstance for REPL.LineEdit.getEntry(::Dict{Char, Any}, ::Union{Char, String}) (6 children)
157: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict{String, Base.UUID}, ::Any, ::Any) (7 children)
158: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict, ::Int64, ::Any) (7 children)
159: signature Tuple{typeof(!), Any} triggered MethodInstance for (::Base.var"#38#40")(::Core.MethodMatch) (7 children)
160: signature Tuple{typeof(!), Any} triggered MethodInstance for MacroTools.store!(::Dict{Any, Any}, ::Symbol, ::Any) (7 children)
161: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{String}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.By{Pkg.API.var"#3#5", Base.Order.ForwardOrdering}) (8 children)
162: signature Tuple{typeof(!), Any} triggered MethodInstance for Pkg.REPLMode.Command(::Pkg.REPLMode.Statement) (9 children)
163: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Any}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.By{Base.var"#874#880", Base.Order.ForwardOrdering}) (10 children)
164: signature Tuple{typeof(!), Any} triggered MethodInstance for MacroTools.store!(::Dict{Any, Any}, ::Symbol, ::Vector{Any}) (11 children)
165: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{Int64}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (12 children)
166: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{String}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.By{Pkg.Types.var"#30#32", Base.Order.ForwardOrdering}) (12 children)
167: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.Order.lt(::Base.Order.Perm{_A, Vector{Int64}} where _A<:Base.Order.Ordering, ::Int64, ::Int64) (12 children)
168: signature Tuple{typeof(!), Any} triggered MethodInstance for show(::IO, ::TypeVar) (13 children)
169: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.Order.lt(::Base.Order.Perm{_A, Vector{Tuple{Float64, Float64}}} where _A<:Base.Order.Ordering, ::Int64, ::Int64) (15 children)
170: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.Docs.moduledoc(::Any, ::Any, ::Any, ::Any, ::Expr) (16 children)
171: signature Tuple{typeof(!), Any} triggered MethodInstance for SnoopCompile.var"#next_julia_frame#65"(::Bool, ::Bool, ::typeof(SnoopCompile.next_julia_frame), ::Any, ::Int64, ::Int64) (17 children)
172: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.BinaryPlatforms.platforms_match(::Base.BinaryPlatforms.AbstractPlatform, ::Base.BinaryPlatforms.Platform) (18 children)
173: signature Tuple{typeof(!), Any} triggered MethodInstance for isequal(::Vector{Any}, ::Vector{Any}) (21 children)
174: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict{String, Union{Base.SHA1, String}}, ::Any, ::Any) (22 children)
175: signature Tuple{typeof(!), Any} triggered MethodInstance for REPL.REPLCompletions.get_value(::Expr, ::Module) (22 children)
176: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict{Char, Any}, ::Any, ::Any) (23 children)
177: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.Order.lt(::Base.Order.Perm{<:Base.Order.ForwardOrdering, <:Union{AbstractVector{Union{Missing, Float32}}, AbstractVector{Union{Missing, Float64}}, AbstractVector{Missing}, AbstractVector{Float32}, AbstractVector{Float64}}}, ::Int64, ::Int64) (30 children)
178: signature Tuple{typeof(!), Any} triggered MethodInstance for isinf(::AbstractFloat) (30 children)
179: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict, ::String, ::Any) (31 children)
180: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.Order.lt(::Base.Order.Perm{_A, Vector{Base.StackTraces.StackFrame}} where _A<:Base.Order.Ordering, ::Int64, ::Int64) (37 children)
181: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.Order.lt(::Base.Order.Perm{_A, Vector{Float64}} where _A<:Base.Order.Ordering, ::Int64, ::Int64) (40 children)
182: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict{String, Any}, ::Any, ::Any) (42 children)
183: signature Tuple{typeof(!), Any} triggered MethodInstance for REPL.LineEdit.var"#add_nested_key!#24"(::Any, ::typeof(REPL.LineEdit.add_nested_key!), ::Dict, ::Union{Char, String}, ::Any) (47 children)
184: signature Tuple{typeof(!), Any} triggered MethodInstance for Base.Order.lt(::Base.Order.Perm{<:Base.Order.ReverseOrdering{Base.Order.ForwardOrdering}, <:Union{AbstractVector{Union{Missing, Float32}}, AbstractVector{Union{Missing, Float64}}, AbstractVector{Missing}, AbstractVector{Float32}, AbstractVector{Float64}}}, ::Int64, ::Int64) (64 children)
185: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict{_A, Nothing} where _A, ::Nothing, ::Any) (70 children)
186: signature Tuple{typeof(!), Any} triggered MethodInstance for sort!(::Vector{String}, ::Int64, ::Int64, ::Base.Sort.InsertionSortAlg, ::Base.Order.Ordering) (126 children)
187: signature Tuple{typeof(!), Any} triggered MethodInstance for setindex!(::Dict, ::Any, ::Any) (254 children)
188: signature !=(x, y) in Base at operators.jl:282 (formerly !=(x, y) in Base at operators.jl:282) triggered MethodInstance for (::ReverseDiff.SkipOptimize{typeof(!=)})(::Int64, ::ReverseDiff.TrackedReal) (1 children)
189: signature !=(x, y) in Base at operators.jl:282 (formerly !=(x, y) in Base at operators.jl:282) triggered MethodInstance for Artifacts.var"#load_overrides#1"(::Bool, ::typeof(Artifacts.load_overrides)) (1 children)
190: signature !=(x, y) in Base at operators.jl:282 (formerly !=(x, y) in Base at operators.jl:282) triggered MethodInstance for ReverseDiff.remove_tp(::Expr) (1 children)
191: signature !=(x, y) in Base at operators.jl:282 (formerly !=(x, y) in Base at operators.jl:282) triggered MethodInstance for Artifacts.var"#artifact_meta#12"(::Base.BinaryPlatforms.Platform, ::typeof(Artifacts.artifact_meta), ::String, ::Dict{String, Any}, ::String) (1 children)
192: signature !=(x, y) in Base at operators.jl:282 (formerly !=(x, y) in Base at operators.jl:282) triggered MethodInstance for Artifacts.process_overrides(::Dict{String, Any}, ::Base.UUID) (1 children)
193: signature !=(x, y) in Base at operators.jl:282 (formerly !=(x, y) in Base at operators.jl:282) triggered MethodInstance for !=(::Int64, ::ForwardDiff.Dual{Ty}) where Ty (1 children)
194: signature !=(x, y) in Base at operators.jl:282 (formerly !=(x, y) in Base at operators.jl:282) triggered MethodInstance for ReverseDiff.combinations(::Vector{Symbol}, ::Int64) (1 children)
195: signature !=(x, y) in Base at operators.jl:282 (formerly !=(x, y) in Base at operators.jl:282) triggered MethodInstance for ReverseDiff.remove_tp(::Any) (1 children)
196: signature !=(x, y) in Base at operators.jl:282 (formerly !=(x, y) in Base at operators.jl:282) triggered MethodInstance for Base.CoreLogging.logging_error(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Bool) (1 children)
false
julia> show(trees[end-2])
inserting promote_rule(::Type{R}, ::Type{ForwardDiff.Dual{T, V, N}}) where {R<:Real, T, V, N} in ForwardDiff at C:\Users\accou\.julia\packages\ForwardDiff\pDtsf\src\dual.jl:425 invalidated:
backedges: 1: superseding promote_rule(::Type, ::Type) in Base at promotion.jl:310 with MethodInstance for promote_rule(::Type{Int64}, ::Type{S} where S<:Real) (5 children)
2: superseding promote_rule(::Type, ::Type) in Base at promotion.jl:310 with MethodInstance for promote_rule(::Type{UInt16}, ::Type) (11 children)
3: superseding promote_rule(::Type, ::Type) in Base at promotion.jl:310 with MethodInstance for promote_rule(::Type{UInt8}, ::Type) (149 children)
4: superseding promote_rule(::Type, ::Type) in Base at promotion.jl:310 with MethodInstance for promote_rule(::Type{Int64}, ::Type) (372 children)
19 mt_cache
false
julia> show(trees[end-3])
inserting tail(t::ChainRulesCore.Tangent{<:NamedTuple{<:Any, <:Tuple{}}}) in ChainRulesCore at C:\Users\accou\.julia\packages\ChainRulesCore\ctmSK\src\tangent_types\tangent.jl:110 invalidated:
mt_backedges: 1: signature Tuple{typeof(Base.tail), Any} triggered MethodInstance for Base._cshp(::Int64, ::Tuple{Bool}, ::Tuple{Int64}, ::Any) (0 children)
2: signature Tuple{typeof(Base.tail), Any} triggered MethodInstance for Base._cshp(::Int64, ::Tuple{Bool}, ::Tuple{Any, Vararg{Any}}, ::Any) (0 children)
3: signature Tuple{typeof(Base.tail), Any} triggered MethodInstance for Base.Iterators._zip_isdone(::Tuple, ::Any) (0 children)
4: signature Tuple{typeof(Base.tail), Any} triggered MethodInstance for Base.Iterators._zip_iterate_some(::Tuple, ::Any, ::Tuple{Missing, Vararg{Any}}, ::Missing) (0 children)
5: signature Tuple{typeof(Base.tail), Any} triggered MethodInstance for Base.Iterators._zip_iterate_some(::Tuple, ::Any, ::Tuple{Any, Vararg{Any}}, ::Missing) (0 children)
6: signature Tuple{typeof(Base.tail), Any} triggered MethodInstance for Base.Iterators._zip_iterate_some(::Tuple, ::Any, ::Tuple{Bool, Vararg{Any}}, ::Bool) (0 children)
7: signature Tuple{typeof(Base.tail), Any} triggered MethodInstance for Base.Iterators._zip_iterate_some(::Tuple, ::Any, ::Tuple{Any, Vararg{Any}}, ::Bool) (0 children)
8: signature Tuple{typeof(Base.tail), Any} triggered MethodInstance for iterate(::Base.Iterators.Enumerate{Vector{VersionNumber}}, ::Any) (0 children)
9: signature Tuple{typeof(Base.tail), Any} triggered MethodInstance for VSCodeServer.JuliaInterpreter.optimize!(::Core.CodeInfo, ::Method) (0 children)
10: signature Tuple{typeof(Base.tail), Any} triggered MethodInstance for JuliaInterpreter.optimize!(::Core.CodeInfo, ::Method) (0 children)
11: signature Tuple{typeof(Base.tail), Any} triggered MethodInstance for LoweredCodeUtils.step_through_methoddef(::Any, ::JuliaInterpreter.Frame, ::Any) (0 children)
12: signature Tuple{typeof(Base.tail), Any} triggered MethodInstance for Base.tail(::NamedTuple{names}) where names (450 children)
false
julia> show(trees[end-4])
inserting checkindex(::Type{Bool}, inds::OffsetArrays.IdOffsetRange, i::Real) in OffsetArrays at C:\Users\accou\.julia\packages\OffsetArrays\80Lkc\src\axes.jl:276 invalidated:
mt_backedges: 1: signature Tuple{typeof(checkindex), Type{Bool}, Any, Int64} triggered MethodInstance for findall(::Function, ::Vector{Core.LineInfoNode}) (0 children)
2: signature Tuple{typeof(checkindex), Type{Bool}, Any, Integer} triggered MethodInstance for findall(::Function, ::Vector{Core.LineInfoNode}) (0 children)
3: signature Tuple{typeof(checkindex), Type{Bool}, Any, Int64} triggered MethodInstance for copy(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Tuple{Base.OneTo{Int64}}, Type{ColorTypes.RGB{FixedPointNumbers.N0f8}}, Tuple{Vector{ColorTypes.LCHab{Float64}}}}) (0 children)
4: signature Tuple{typeof(checkindex), Type{Bool}, Any, Integer} triggered MethodInstance for copy(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Tuple{Base.OneTo{Int64}}, Type{ColorTypes.RGB{FixedPointNumbers.N0f8}}, Tuple{Vector{ColorTypes.LCHab{Float64}}}}) (0 children)
5: signature Tuple{typeof(checkindex), Type{Bool}, Any, Int64} triggered MethodInstance for findall(::Function, ::Vector{Core.LineInfoNode}) (0 children)
6: signature Tuple{typeof(checkindex), Type{Bool}, Any, Integer} triggered MethodInstance for findall(::Function, ::Vector{Core.LineInfoNode}) (0 children)
7: signature Tuple{typeof(checkindex), Type{Bool}, Any, Integer} triggered MethodInstance for LoweredCodeUtils.step_through_methoddef(::Any, ::JuliaInterpreter.Frame, ::Any) (0 children)
8: signature Tuple{typeof(checkindex), Type{Bool}, Any, Int64} triggered MethodInstance for LoweredCodeUtils.step_through_methoddef(::Any, ::JuliaInterpreter.Frame, ::Any) (0 children)
9: signature Tuple{typeof(checkindex), Type{Bool}, Any, Int64} triggered MethodInstance for Base.checkbounds_indices(::Type{Bool}, ::Tuple{Any}, ::Tuple{Vararg{Int64}}) (17 children)
10: signature Tuple{typeof(checkindex), Type{Bool}, Any, Integer} triggered MethodInstance for Base.checkbounds_indices(::Type{Bool}, ::Tuple, ::Tuple{Integer}) (109 children)
backedges: 1: superseding checkindex(::Type{Bool}, inds::AbstractUnitRange, i::Real) in Base at abstractarray.jl:727 with MethodInstance for checkindex(::Type{Bool}, ::AbstractUnitRange, ::Int64) (5 children)
2: superseding checkindex(::Type{Bool}, inds::AbstractUnitRange, i::Real) in Base at abstractarray.jl:727 with MethodInstance for checkindex(::Type{Bool}, ::AbstractUnitRange, ::Integer) (5 children) |
Discovered in SciML/DifferentialEquations.jl#786. They are very old deprecated functions, so might as well just remove.
Running things downstream, life seems to go on without them just fine. Found in SciML/DifferentialEquations.jl#786 and #77, these methods contribute to a ton of recompilation. Methods that cause lots of compilation but aren't used? Bye bye. Users of Static.jl can just manually handle `!`. It's safe because it just throws an error otherwise. We can put it in an FAQ if it's that much of an issue. But this is definitely not worth causing seconds of JIT lag downstream.
@timholy any ideas for anything that can be done for that invalidation? |
SciML/DiffEqBase.jl#736 and SciML/OrdinaryDiffEq.jl#1627 together lead to startup times from 8 seconds to 0.7 without a system image, and down to 0.1 and below with a system image. Without a system image: using OrdinaryDiffEq
function f(du, u, p, t)
du[1] = 0.2u[1]
du[2] = 0.4u[2]
end
u0 = ones(2)
tspan = (0.0, 1.0)
prob = ODEProblem{true,false}(f, u0, tspan, Float64[])
function lorenz(du, u, p, t)
du[1] = 10.0(u[2] - u[1])
du[2] = u[1] * (28.0 - u[3]) - u[2]
du[3] = u[1] * u[2] - (8 / 3) * u[3]
end
lorenzprob = ODEProblem{true,false}(lorenz, [1.0; 0.0; 0.0], (0.0, 1.0), Float64[])
typeof(prob) === typeof(lorenzprob) # true
@time sol = solve(lorenzprob, Rosenbrock23())
# 0.847580 seconds (83.25 k allocations: 3.404 MiB, 99.75% compilation time)
@time sol = solve(lorenzprob, Rosenbrock23(autodiff=false))
# 0.701598 seconds (499.23 k allocations: 28.846 MiB, 99.73% compilation time)
@time sol = solve(lorenzprob, Rosenbrock23())
# 0.000113 seconds (457 allocations: 39.828 KiB)
@time sol = solve(lorenzprob, Rosenbrock23(autodiff=false))
# 0.000147 seconds (950 allocations: 45.547 KiB)
lorenzprob2 = ODEProblem(lorenz, [1.0; 0.0; 0.0], (0.0, 1.0), Float64[])
@time sol = solve(lorenzprob2, Rosenbrock23())
# 8.587653 seconds (24.77 M allocations: 3.581 GiB, 5.37% gc time, 99.99% compilation time)
@time sol = solve(lorenzprob2, Rosenbrock23(autodiff=false))
# 1.122847 seconds (3.69 M allocations: 211.491 MiB, 2.45% gc time, 99.98% compilation time)
@time sol = solve(lorenzprob2, Rosenbrock23())
# 0.000120 seconds (455 allocations: 39.531 KiB)
@time sol = solve(lorenzprob2, Rosenbrock23(autodiff=false))
# 0.000138 seconds (950 allocations: 45.188 KiB) With a system image: using PackageCompiler
create_sysimage(["OrdinaryDiffEq"], sysimage_path="DiffEqSysImage.so")
using OrdinaryDiffEq
function f(du, u, p, t)
du[1] = 0.2u[1]
du[2] = 0.4u[2]
end
u0 = ones(2)
tspan = (0.0, 1.0)
prob = ODEProblem{true,false}(f, u0, tspan, Float64[])
function lorenz(du, u, p, t)
du[1] = 10.0(u[2] - u[1])
du[2] = u[1] * (28.0 - u[3]) - u[2]
du[3] = u[1] * u[2] - (8 / 3) * u[3]
end
lorenzprob = ODEProblem{true,false}(lorenz, [1.0; 0.0; 0.0], (0.0, 1.0), Float64[])
typeof(prob) === typeof(lorenzprob) # true
@time sol = solve(lorenzprob, Rosenbrock23())
# 0.133316 seconds (4.66 k allocations: 309.428 KiB, 2.40% compilation time)
@time sol = solve(lorenzprob, Rosenbrock23(autodiff=false))
# 0.097989 seconds (432.99 k allocations: 26.587 MiB, 99.01% compilation time)
@time sol = solve(lorenzprob, Rosenbrock23())
# 0.000105 seconds (457 allocations: 39.828 KiB)
@time sol = solve(lorenzprob, Rosenbrock23(autodiff=false))
# 0.000138 seconds (950 allocations: 45.547 KiB)
lorenzprob2 = ODEProblem(lorenz, [1.0; 0.0; 0.0], (0.0, 1.0), Float64[])
@time sol = solve(lorenzprob2, Rosenbrock23())
# 7.651692 seconds (23.73 M allocations: 3.516 GiB, 8.12% gc time, 99.99% compilation time)
@time sol = solve(lorenzprob2, Rosenbrock23(autodiff=false))
# 1.120606 seconds (2.67 M allocations: 145.677 MiB, 27.06% gc time, 99.98% compilation time)
@time sol = solve(lorenzprob2, Rosenbrock23())
# 0.000098 seconds (455 allocations: 39.531 KiB)
@time sol = solve(lorenzprob2, Rosenbrock23(autodiff=false))
# 0.000140 seconds (950 allocations: 45.188 KiB) Before: After: More interestingly, it puts us into the paradigm where most ODE solve calls are actually fully precompiled, separately from the |
The function specialization precompilation system is now fully documented: https://scimlbase.sciml.ai/stable/interfaces/Problems/#Specialization-Levels |
On v1.10 out of the box with no system image: using OrdinaryDiffEq
function lorenz(du, u, p, t)
du[1] = 10.0(u[2] - u[1])
du[2] = u[1] * (28.0 - u[3]) - u[2]
du[3] = u[1] * u[2] - (8 / 3) * u[3]
end
@time begin
lorenzprob = ODEProblem{true, SciMLBase.AutoSpecialize}(lorenz, [1.0; 0.0; 0.0], (0.0, 1.0), Float64[])
sol = solve(lorenzprob, Rosenbrock23())
end
# 0.096844 seconds (106.87 k allocations: 7.286 MiB, 99.59% compilation time) Load times can improve still, but I think we can call this one a victory and close it, leaving any specific compile time issues to their own thread. The details for how this was done is captured in this blog post: https://sciml.ai/news/2022/09/21/compile_time/ |
Take awhile to precompile with style all of the DiffEq stack, no denial
Our goal is to get the entire DiffEq stack compile times down. From now on we should treat compile time issues and compile time regressions just like we treat performance issues, 😢 😿 😭 and then fix them. For a very long time we did not do this because, unlike runtime performance, we did not have a good way to diagnose the causes, so it was 🤷 whatever we got is what we got, move on. But now, thanks to @timholy, we have the right tools and have learned how to handle compile time issues in a very deep way so the game is on.
Our goal is to get compile times of all standard workflows to at least 0.1 seconds. That is quick enough that you wouldn't care all that much in interactive usage, but still not an unreasonable goal given the benchmarks. This issue is how to get there and how the community is can help. This will cover:
Let's dig in.
What were our first strides?
We have already made a great leap forward in the last week+ since the JuliaCon hackathon. The very long tl;dr i in SciML/DiffEqBase.jl#698 . However, that doesn't capture the full scope of what was actually done:
map
JuliaDiff/SparseDiffTools.jl#149with some bonus PRs and issues like:
Show me some results
The net result is something like this. On non-stiff ODEs, compile times dropped from about 5 seconds to sub 1 second, and on stiff ODEs compile times dropped from about 22 seconds to 2.5 seconds. The tests are things like:
SciML/OrdinaryDiffEq.jl#1465
You read this as, it used to take 1.25 seconds for inference and 4.88 seconds for compilation in full, but now it's 0.63 and 0.88.
and SciML/DiffEqBase.jl#698
So that's the good news. The bad news.
The precompilation results do not always generalize
Take for example #785:
"But Chris, I thought you just said that was sub 3 seconds, not 13.75 seconds compile time!". Well, that's with
using OrdinaryDiffEq
instead ofusing DifferentialEquations
. And we see this when DiffEqSensitivity.jl or DiffEqFlux.jl gets involved.So compile times are "a lot better"*, and the
"
+*
are right now necessary when saying that. We need to fix that aspect of it.How can I as a user help?
Good question, thanks for asking! Sharing profiles is extremely helpful. Take another look at SciML/DiffEqBase.jl#698 (comment) . What was ran was:
What this was saying was that the vast majority of the compile time was because the
DEFAULT_LINSOLVE
calling RecursiveFactorization.jl was not precompiling. Since we use our own full Julia-based BLAS/LAPACK stack, that gave a full 13 seconds of compilation since it would compile RecursiveFactorization.jl, TriangularSolve.jl, etc. in sequence on each first solve call of a session. This allowed us to identify the issue can create a tizzy of PRs that finally made that get cached.If you check the DifferentialEquations.jl compile times, you'll see that part is back. Why won't it compile? Well that's a harder question, discussed in SciML/DiffEqBase.jl#698 (comment), with the fix in SciML/DiffEqBase.jl#698 (comment), but apparently gets invalidated. If that all doesn't make sense to you, that's fine! But if you can help us narrow in on what the real issues are, that will help us immensely.
And of course... you can always give us a sponsor and star the repos to help 😅 . But seriously though, I hope we can start using SciML funds to start scouring our repos and get a lot of people fixing compile time issues. More on that soon... very soon... 🤐
What are some helpful tricks and knowledge to share?
Yeah, what were our tricks? Well the big one is forcing compilation in using calls through small solves. In many cases compilation is solved by just putting a prototype solve inside of the package itself. For example, take a look at the precompile section of OrdinaryDiffEq.jl (https://github.com/SciML/OrdinaryDiffEq.jl/blob/v5.61.1/src/OrdinaryDiffEq.jl#L175-L193)
Lorenz equation takes nanoseconds to solve, so we take this equation and solve it a few times at
using
time, which will then trigger precompilation of as many functions hit in that call stack as Julia will allow for. For some things, the reason why they are not precompiled is simply because they are never called duringusing
time, so a quick fix for many of the compile time issues is to simply add a short little statement like this tousing
time and then Julia will cache its results. For everything else, there's Mastercard, and it'll be much more costly to solve, so those will need issues and the experts, and possibly some Base compiler changes. But we should at least grab all of the low hanging fruit ASAP.This is actually a necessary condition for getting precompilation, since if a method is never called in using then it will never precompile, so this is a first step among many.
A major part of the solution was avoiding codegen when unnecessary. If you take a look at SciML/OrdinaryDiffEq.jl#1465, you'll see things like:
i.e. new solver dispatches specifically for
Array
, to avoid dispatches like:The reason is that compile time profiling showcased that the major contributor was these https://github.com/YingboMa/FastBroadcast.jl code generation steps. Base Broadcast too is a major contributor to compile times. So at least on the pieces of code that 99% of users are using, we just expanded them out by hand, forced them to precompile, and that gave the 5 seconds to 1 second compile time change. I wouldn't say I am recommending you shouldn't use broadcast, but this is something useful to keep in mind. Broadcast is more generic, so you have to pay in compile time to use it. If you're willing to maintain the code, doing
if u isa Array
or making a separate dispatch can remove that factor.Map is also a major contributor. We actually knew this was the case already, since there was a map call which changed Pumas compile times on a small example from 3 seconds to over 40 (SciML/SciMLBase.jl#45). Removing map calls factored into these changes as well (JuliaDiff/SparseDiffTools.jl#149). Again, this is something that could/should be handled at the Base compiler level, but we wanted as much of a fix ASAP so this was a nice and easy change which was within our power to ship in a week, and you can do the same.
The last thing, and the major step forward, was SciML/DiffEqBase.jl#698 (comment) . As it explains, using a function barrier can cause inference to not know what functions it will need in a call, which makes Julia seem to compile a whole lot of junk. That can probably get fixed at the Base compiler level to some extent, as the example there was spending 13 seconds compiling
(::DefaultLinSolve)(::Vector{Float64}, ::Any, ::Vector{Float64}, ::Bool)
junk which nobody could ever call, since any call to that function would specialize on the second argument (a matrix type) and so it should've been compiling(::DefaultLinSolve)(::Vector{Float64}, ::Matrix{Float64}, ::Vector{Float64}, ::Bool)
. But since that call was already precompiled, if inference ends up good enough that it realized it would call that instead, then bingo compile times dropped from 16 seconds to sub 3. That's a nice showcase that the easiest way to fix compile time issues may be to fix inference issues in a package, because that can make Julia narrow down what methods it needs to compile more, and then it may have a better chance of hitting the pieces that you told it to precompile (via a using-time example in a precompile.jl).However, even if you have dynamism, you can still improve inference. The DiffEq problem was that ForwardDiff has a dynamically chosen
chunksize
based on the size of the input ODEsu
. We previously would defer this calculation of the chunksize until the caches for the Jacobian were built, so then all dual number caches would have awhere N
on the chunk size from inference. But a function barrier makes the total runtime cost 100ns, so whatever that's solved right? But because all of the caches have this non-inference of the chunksize, Julia's compiler could not determine all of theN
's were the same, so inference would see far too many types in expressions and just give up. That's howA::Matrix{Float64}
becameAny
in the inference passes. When Julia hits the function barrier, it will cause inference to trigger again, in which case inside the function it will now be type-stable, so again no runtime cost, but at the first compile it will compile all possible methods it may ever need to call... which is a much bigger universe than what we actually hit. We noticed this was the case because if the user manually put in a chunksize, i.e.Rodas5(chunk_size = 3)
, then this all went away. So what we did was setup a hook so that the momentsolve
is called, it goes "have you defined the chunk size? If not, let's figure it out right away and then hit__solve
. By doing this function barrier earlier, it at least knows that the chunk size should always match theN
type parameter of the solver algorithm, so all of theN
s are the same, which makes it realize there's less types and use more of the compile caches before.That one is harder than the others, but it makes the more general point that caching compilation is only good if inference is good enough.
And of course, check out Tim Holy's workshop and JuliaCon video which is immensely helpful at getting started.
https://www.youtube.com/watch?v=rVBgrWYKLHY
https://www.youtube.com/watch?v=wXRMwJdEjX4
What are the next steps?
Well, the next steps are to get the compile times below 0.1 seconds everywhere of course. I've already identified some issues to solve:
Are there more things just missing some simple precompiles? Are there some major threads we're missing? Help us identify where all of this is so we can solve it in full.
Compile times, here we come!
The text was updated successfully, but these errors were encountered: