@tim.holy here’s a fresh invalidation issue. CategoricalArrays seems to invalidate OpenSpecFun_jll compilation.
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.9.0-DEV.1433 (2022-09-24)
_/ |\__'_|_|_|\__'_| | Commit e6d99792e6* (0 days old master)
|__/ |
julia> @time_imports using CategoricalArrays, OpenSpecFun_jll
1.6 ms DataAPI
12.1 ms Missings
0.4 ms Requires
1.1 ms Statistics
205.0 ms CategoricalArrays 13.56% compilation time (10% recompilation)
38.1 ms Preferences
0.5 ms JLLWrappers
403.5 ms OpenSpecFun_jll 99.80% compilation time (99% recompilation)
Unfortunately, JET.jl is having issues with master at the moment, so I cannot load SnoopCompile.jl to analyze further on master.
julia> using SnoopCompile
[ Info: Precompiling SnoopCompile [aa65fe97-06da-5843-b5b1-d5d13cad87d2]
ERROR: LoadError: MethodError: no method matching Core.Compiler.OptimizationParams(; inlining::Bool, inline_cost_threshold::Int64, inline_nonleaf_penalty::Int64, inline_tupleret_bonus::Int64, inline_error_path_cost::Int64, max_methods::Int64, tuple_splat::Int64, union_splitting::Int64)
Closest candidates are:
Core.Compiler.OptimizationParams(; inlining, inline_cost_threshold, inline_nonleaf_penalty, inline_tupleret_bonus, inline_error_path_cost, tuple_splat, compilesig_invokes, trust_inference, assume_fatal_throw) got unsupported keyword arguments "max_methods", "union_splitting"
@ Core compiler/types.jl:78
I can replicate the issue with Julia 1.8.1.
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.8.1 (2022-09-06)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> @time_imports using CategoricalArrays, OpenSpecFun_jll
4.6 ms DataAPI
31.7 ms Missings
0.9 ms Requires
206.2 ms CategoricalArrays 14.67% compilation time (6% recompilation)
26.5 ms Preferences
0.5 ms JLLWrappers
0.4 ms CompilerSupportLibraries_jll
481.3 ms OpenSpecFun_jll 99.86% compilation time (99% recompilation)
using SnoopCompileCore
invalidations = @snoopr using CategoricalArrays, OpenSpecFun_jll
trees = invalidation_trees(invalidations)
julia> trees = invalidation_trees(invalidations)
14-element Vector{SnoopCompile.MethodInvalidations}:
inserting insert!(A::CategoricalVector{>:Missing}, i::Integer, v::Missing) in CategoricalArrays at /home/mkitti/.julia/packages/CategoricalArrays/zg8z5/src/missingarray.jl:30 invalidated:
mt_backedges: 1: signature Tuple{typeof(insert!), Any, Any, Any} triggered MethodInstance for InteractiveUtils.gen_call_with_extracted_types(::Module, ::Function, ::Expr, ::Vector{Expr}) (0 children)
2: signature Tuple{typeof(insert!), Any, Any, Any} triggered MethodInstance for InteractiveUtils.gen_call_with_extracted_types(::Module, ::typeof(Base.return_types), ::Expr, ::Vector{Expr}) (0 children)
inserting (::Base.var"#sort!##kw")(::Any, ::typeof(sort!), v::CategoricalVector) in CategoricalArrays at /home/mkitti/.julia/packages/CategoricalArrays/zg8z5/src/array.jl:1088 invalidated:
mt_backedges: 1: signature Tuple{Base.var"#sort!##kw", NamedTuple{(:by,), Tuple{typeof(identity)}}, typeof(sort!), Any} triggered MethodInstance for TOML.Internals.Printer.var"#_print#10"(::Int64, ::Bool, ::Bool, ::typeof(identity), ::typeof(TOML.Internals.Printer._print), ::Nothing, ::IOStream, ::AbstractDict, ::Vector{String}) (0 children)
inserting similar(A::Matrix, ::Type{CategoricalValue{T}}, dims::Tuple{Vararg{Int64, N}}) where {T, N} in CategoricalArrays at /home/mkitti/.julia/packages/CategoricalArrays/zg8z5/src/array.jl:675 invalidated:
backedges: 1: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Array, ::Type, ::Tuple{Int64}) (2 children)
inserting similar(A::Matrix, ::Type{CategoricalValue{T, R}}, dims::Tuple{Vararg{Int64, N}}) where {T, R, N} in CategoricalArrays at /home/mkitti/.julia/packages/CategoricalArrays/zg8z5/src/array.jl:672 invalidated:
backedges: 1: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Array, ::DataType, ::Tuple{Int64}) (2 children)
inserting similar(A::AbstractRange, ::Type{CategoricalValue{T, R}}, dims::Tuple{Vararg{Int64, N}}) where {T, R, N} in CategoricalArrays at /home/mkitti/.julia/packages/CategoricalArrays/zg8z5/src/array.jl:672 invalidated:
backedges: 1: superseding similar(a::AbstractArray, ::Type{T}, dims::Tuple{Vararg{Int64, N}}) where {T, N} in Base at abstractarray.jl:806 with MethodInstance for similar(::UnitRange{Int64}, ::DataType, ::Tuple{Int64}) (3 children)
inserting similar(A::AbstractRange, ::Type{Union{Missing, CategoricalValue{T}}}, dims::Tuple{Vararg{Int64, N}}) where {T, N} in CategoricalArrays at /home/mkitti/.julia/packages/CategoricalArrays/zg8z5/src/array.jl:681 invalidated:
backedges: 1: superseding similar(a::AbstractArray, ::Type{T}, dims::Tuple{Vararg{Int64, N}}) where {T, N} in Base at abstractarray.jl:806 with MethodInstance for similar(::UnitRange{Int64}, ::Type, ::Tuple{Int64}) (3 children)
2: superseding similar(a::AbstractArray, ::Type{T}, dims::Tuple{Vararg{Int64, N}}) where {T, N} in Base at abstractarray.jl:806 with MethodInstance for similar(::UnitRange{Int64}, ::Type, ::Tuple{Int64}) (5 children)
inserting similar(A::Vector, ::Type{CategoricalValue{T, R}}, dims::Tuple{Vararg{Int64, N}}) where {T, R, N} in CategoricalArrays at /home/mkitti/.julia/packages/CategoricalArrays/zg8z5/src/array.jl:672 invalidated:
backedges: 1: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Vector{SubString{String}}}, ::DataType, ::Tuple{Int64}) (1 children)
2: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{String}, ::DataType, ::Tuple{Int64}) (1 children)
3: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Pair{DataType, Function}}, ::DataType, ::Tuple{Int64}) (1 children)
4: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Any}, ::DataType, ::Tuple{Int64}) (1 children)
5: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Dict{Any, Any}}, ::DataType, ::Tuple{Int64}) (1 children)
6: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Dict{Char, Any}}, ::DataType, ::Tuple{Int64}) (1 children)
7: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{SubString{String}}, ::DataType, ::Tuple{Int64}) (1 children)
8: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Symbol}, ::DataType, ::Tuple{Int64}) (1 children)
9: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{LibGit2.FetchHead}, ::DataType, ::Tuple{Int64}) (1 children)
10: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{LibGit2.GitAnnotated}, ::DataType, ::Tuple{Int64}) (1 children)
11: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Set{Int64}}, ::DataType, ::Tuple{Int64}) (1 children)
12: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Vector{Pkg.Resolve.FieldValue}}, ::DataType, ::Tuple{Int64}) (1 children)
13: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Tuple{Base.UUID, String, String, VersionNumber}}, ::DataType, ::Tuple{Int64}) (1 children)
14: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Base.PkgId}, ::DataType, ::Tuple{Int64}) (1 children)
15: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Pkg.REPLMode.Option}, ::DataType, ::Tuple{Int64}) (1 children)
16: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Pkg.REPLMode.Statement}, ::DataType, ::Tuple{Int64}) (1 children)
17: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Base.StackTraces.StackFrame}, ::DataType, ::Tuple{Int64}) (1 children)
18: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Tuple{Base.StackTraces.StackFrame, Int64}}, ::DataType, ::Tuple{Int64}) (1 children)
19: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{REPL.REPLCompletions.Completion}, ::DataType, ::Tuple{Int64}) (1 children)
20: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Tuple{Int64, Int64}}, ::DataType, ::Tuple{Int64}) (1 children)
21: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Pkg.REPLMode.OptionSpec}, ::DataType, ::Tuple{Int64}) (1 children)
inserting convert(::Type{S}, x::CategoricalValue) where S<:Union{AbstractChar, AbstractString, Number} in CategoricalArrays at /home/mkitti/.julia/packages/CategoricalArrays/zg8z5/src/value.jl:92 invalidated:
mt_backedges: 1: signature Tuple{typeof(convert), Type{SubString{String}}, Any} triggered MethodInstance for push!(::Vector{SubString{String}}, ::Any) (5 children)
2: signature Tuple{typeof(convert), Type{Union{Bool, String}}, Any} triggered MethodInstance for setindex!(::Dict{String, Union{Bool, String}}, ::Any, ::String) (9 children)
backedges: 1: superseding convert(::Type{Union{}}, x) in Base at essentials.jl:213 with MethodInstance for convert(::Core.TypeofBottom, ::Any) (13 children)
inserting similar(A::Vector, ::Type{CategoricalValue{T}}) where T in CategoricalArrays at /home/mkitti/.julia/packages/CategoricalArrays/zg8z5/src/array.jl:675 invalidated:
backedges: 1: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:375 with MethodInstance for similar(::Vector{Tuple{Symbol, Symbol}}, ::Type) (3 children)
2: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:375 with MethodInstance for similar(::Vector{UnionAll}, ::Type) (5 children)
3: superseding similar(a::Vector{T}, S::Type) where T in Base at array.jl:375 with MethodInstance for similar(::Vector, ::Type) (128 children)
10 mt_cache
inserting similar(A::Vector, ::Type{CategoricalValue{T}}, dims::Tuple{Vararg{Int64, N}}) where {T, N} in CategoricalArrays at /home/mkitti/.julia/packages/CategoricalArrays/zg8z5/src/array.jl:675 invalidated:
mt_backedges: 1: signature Tuple{typeof(similar), Vector, Any, Tuple{Int64}} triggered MethodInstance for similar(::Vector, ::Tuple{Base.OneTo{Int64}}) (2 children)
backedges: 1: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{UInt32}, ::Type, ::Tuple{Int64}) (1 children)
2: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector, ::Type, ::Tuple{Int64}) (1 children)
3: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Vector{SubString{String}}}, ::Type, ::Tuple{Int64}) (8 children)
4: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Pair{DataType, Function}}, ::Type, ::Tuple{Int64}) (8 children)
5: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{SubString{String}}, ::Type, ::Tuple{Int64}) (8 children)
6: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Dict{Any, Any}}, ::Type, ::Tuple{Int64}) (8 children)
7: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Dict{Char, Any}}, ::Type, ::Tuple{Int64}) (8 children)
8: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Symbol}, ::Type, ::Tuple{Int64}) (8 children)
9: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{LibGit2.FetchHead}, ::Type, ::Tuple{Int64}) (8 children)
10: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{LibGit2.GitAnnotated}, ::Type, ::Tuple{Int64}) (8 children)
11: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Set{Int64}}, ::Type, ::Tuple{Int64}) (8 children)
12: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Vector{Pkg.Resolve.FieldValue}}, ::Type, ::Tuple{Int64}) (8 children)
13: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Tuple{Base.UUID, String, String, VersionNumber}}, ::Type, ::Tuple{Int64}) (8 children)
14: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Base.PkgId}, ::Type, ::Tuple{Int64}) (8 children)
15: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Pkg.REPLMode.Option}, ::Type, ::Tuple{Int64}) (8 children)
16: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Pkg.REPLMode.Statement}, ::Type, ::Tuple{Int64}) (8 children)
17: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Base.StackTraces.StackFrame}, ::Type, ::Tuple{Int64}) (8 children)
18: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Tuple{Base.StackTraces.StackFrame, Int64}}, ::Type, ::Tuple{Int64}) (8 children)
19: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{REPL.REPLCompletions.Completion}, ::Type, ::Tuple{Int64}) (8 children)
20: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Tuple{Int64, Int64}}, ::Type, ::Tuple{Int64}) (8 children)
21: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Pkg.REPLMode.OptionSpec}, ::Type, ::Tuple{Int64}) (8 children)
22: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{String}, ::Type, ::Tuple{Int64}) (9 children)
23: superseding similar(a::Array, T::Type, dims::Tuple{Vararg{Int64, N}}) where N in Base at array.jl:378 with MethodInstance for similar(::Vector{Any}, ::Type, ::Tuple{Int64}) (23 children)
30 mt_cache
inserting isequal(x::Union{AbstractChar, AbstractString, Number}, y::CategoricalValue) in CategoricalArrays at /home/mkitti/.julia/packages/CategoricalArrays/zg8z5/src/value.jl:142 invalidated:
backedges: 1: superseding isequal(x, y) in Base at operators.jl:140 with MethodInstance for isequal(::Int64, ::Any) (3 children)
2: superseding isequal(x, y) in Base at operators.jl:140 with MethodInstance for isequal(::Char, ::Any) (44 children)
3: superseding isequal(x, y) in Base at operators.jl:140 with MethodInstance for isequal(::String, ::Any) (241 children)
inserting isequal(x::CategoricalValue, y::Union{AbstractChar, AbstractString, Number}) in CategoricalArrays at /home/mkitti/.julia/packages/CategoricalArrays/zg8z5/src/value.jl:141 invalidated:
backedges: 1: superseding isequal(x, y) in Base at operators.jl:140 with MethodInstance for isequal(::Any, ::Char) (228 children)
2: superseding isequal(x, y) in Base at operators.jl:140 with MethodInstance for isequal(::Any, ::String) (298 children)
143 mt_cache
inserting similar(::Type{T}, dims::Tuple{Vararg{Int64, N}} where N) where {U, T<:(Array{Union{Missing, CategoricalValue{U}}})} in CategoricalArrays at /home/mkitti/.julia/packages/CategoricalArrays/zg8z5/src/array.jl:692 invalidated:
backedges: 1: superseding similar(::Type{T}, dims::Tuple{Vararg{Int64, N}} where N) where T<:AbstractArray in Base at abstractarray.jl:841 with MethodInstance for similar(::Type{Array{_A}} where _A, ::Tuple{Int64}) (64 children)
2: superseding similar(::Type{T}, dims::Tuple{Vararg{Int64, N}} where N) where T<:AbstractArray in Base at abstractarray.jl:841 with MethodInstance for similar(::Type{Vector{_A}} where _A, ::Tuple{Int64}) (569 children)
inserting convert(::Type{Union{Nothing, S}}, x::CategoricalValue) where S<:Union{AbstractChar, AbstractString, Number} in CategoricalArrays at /home/mkitti/.julia/packages/CategoricalArrays/zg8z5/src/value.jl:96 invalidated:
mt_backedges: 1: signature convert(::Type{Nothing}, x) in Base at some.jl:37 (formerly convert(::Type{Nothing}, x) in Base at some.jl:37) triggered MethodInstance for Preferences.load_preference(::Base.UUID, ::String, ::Nothing) (0 children)
backedges: 1: superseding convert(::Type{Nothing}, x) in Base at some.jl:37 with MethodInstance for convert(::Type{Nothing}, ::Any) (2537 children)
34 mt_cache
Breaking this down the issue seems to be convert(::Type{Nothing}, ::Any)
being invalidated inserting convert(::Type{Union{Nothing, S}}, x::CategoricalValue) where S<:Union{AbstractChar, AbstractString, Number}
in CategoricalArrays at CategoricalArrays/zg8z5/src/value.jl:96
:
julia> trees[end].backedges[1]
MethodInstance for convert(::Type{Nothing}, ::Any) at depth 0 with 2537 children
julia> trees[end].backedges[1].children
3-element Vector{SnoopCompile.InstanceNode}:
MethodInstance for setindex!(::IdDict{Any, Nothing}, ::Any, ::Any) at depth 1 with 2527 children
MethodInstance for setindex!(::IdDict{Dict{String, Any}, Nothing}, ::Any, ::Any) at depth 1 with 7 children
MethodInstance for SnoopCompileCore.__init__() at depth 1 with 0 children
julia> trees[end].backedges[1].children[1]
MethodInstance for setindex!(::IdDict{Any, Nothing}, ::Any, ::Any) at depth 1 with 2527 children
julia> trees[end].backedges[1].children[1].children
6-element Vector{SnoopCompile.InstanceNode}:
MethodInstance for push!(::Base.IdSet{Any}, ::Any) at depth 2 with 988 children
MethodInstance for push!(::Base.IdSet{Any}, ::TypeVar) at depth 2 with 1239 children
MethodInstance for push!(::Base.IdSet{Any}, ::Vector{Union{}}) at depth 2 with 0 children
MethodInstance for push!(::Base.IdSet{Any}, ::Vector) at depth 2 with 293 children
MethodInstance for push!(::Base.IdSet{Any}, ::DataType) at depth 2 with 1 children
MethodInstance for SnoopCompileCore.__init__() at depth 2 with 0 children