-
Notifications
You must be signed in to change notification settings - Fork 3
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
SnoopCompile investigation #122
Comments
Moving on to analyzing inference with InferenceTimingNode: 28.898476/29.122585 on Core.Compiler.Timings.ROOT() with 3 direct children
├─ InferenceTimingNode: 0.000201/0.000292 on Base.MainInclude.include(::String) with 1 direct children
│ └─ InferenceTimingNode: 0.000091/0.000091 on getproperty(Base::Module, _include::Symbol) with 0 direct children
├─ InferenceTimingNode: 0.000073/0.000251 on TracerSparsityDetector() with 1 direct children
│ └─ InferenceTimingNode: 0.000045/0.000179 on SparseConnectivityTracer.var"#TracerSparsityDetector#22"(::Type{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}}, ::Type{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}, ::Type{TracerSparsityDetector}) with 1 direct children
│ └─ InferenceTimingNode: 0.000073/0.000134 on TracerSparsityDetector(::Type{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}}, ::Type{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}) with 1 direct children
│ └─ InferenceTimingNode: 0.000062/0.000062 on TracerSparsityDetector{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}() with 0 direct children
└─ InferenceTimingNode: 0.000104/0.223566 on ADTypes.hessian_sparsity(sum_britgas_cons::typeof(sum_britgas_cons), ::Vector{Float64}, TracerSparsityDetector{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}()::TracerSparsityDetector{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}) with 1 direct children
└─ InferenceTimingNode: 0.000324/0.223462 on SparseConnectivityTracer.hessian_pattern(sum_britgas_cons::typeof(sum_britgas_cons), ::Vector{Float64}, ::Type{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}) with 6 direct children
├─ InferenceTimingNode: 0.000135/0.196236 on SparseConnectivityTracer.trace_function(::Type{SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}}, sum_britgas_cons::typeof(sum_britgas_cons), ::Vector{Float64}) with 2 direct children
│ ├─ InferenceTimingNode: 0.000078/0.024021 on SparseConnectivityTracer.trace_input(::Type{SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}}, ::Vector{Float64}) with 1 direct children
│ │ └─ InferenceTimingNode: 0.001155/0.023943 on SparseConnectivityTracer.trace_input(::Type{SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}}, ::Vector{Float64}, ::Int64) with 6 direct children
│ │ ⋮
│ │
│ └─ InferenceTimingNode: 0.001732/0.172080 on sum_britgas_cons(::Vector{SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}}) with 2 direct children
│ ├─ InferenceTimingNode: 0.074998/0.162375 on britgas_cons(::Vector{SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}}) with 22 direct children
│ │ ⋮
│ │
│ └─ InferenceTimingNode: 0.000117/0.007973 on sum(::Vector{SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}}) with 1 direct children
│ ⋮
│
├─ InferenceTimingNode: 0.000098/0.000263 on Base.indexed_iterate(::Tuple{Vector{SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}}, SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}}, ::Int64) with 2 direct children
│ ├─ InferenceTimingNode: 0.000164/0.000164 on Base.indexed_iterate(::Tuple{Vector{SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}}, SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}}, ::Int64, ::Int64) with 0 direct children
│ └─ InferenceTimingNode: 0.000001/0.000001 on Base.indexed_iterate(::Tuple{Vector{SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}}, SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}}, ::Int64, 1::Int64) with 0 direct children
├─ InferenceTimingNode: 0.000016/0.000016 on Base.indexed_iterate(::Tuple{Vector{SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}}, SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}}, 1::Int64) with 0 direct children
├─ InferenceTimingNode: 0.000008/0.000008 on Base.indexed_iterate(::Tuple{Vector{SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}}, SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}}, 2::Int64, 2::Int64) with 0 direct children
├─ InferenceTimingNode: 0.000024/0.000024 on SparseConnectivityTracer.to_array(::Vector{SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}}) with 0 direct children
└─ InferenceTimingNode: 0.001054/0.026590 on SparseConnectivityTracer.hessian_pattern_to_mat(::Vector{SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}}, ::SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.CombinedPattern{SparseConnectivityTracer.IndexSetVectorPattern{Int64, BitSet}, SparseConnectivityTracer.IndexSetMatrixPattern{Int64, Set{Tuple{Int64, Int64}}}}}) with 10 direct children Judging by the documentation:
In other words we spent most of the time doing stuff that is not inference (which is not very surprising since the code is type-stable). |
Most promising avenue: https://timholy.github.io/SnoopCompile.jl/dev/pgdsgui/#pgds |
Closing this, since the cause of the compile time problem in #120 has been found and fixes. The solution is described here: Invalidations on |
Since we're having latency trouble in #120, I thought it would be interesting to analyze method invalidations with SnoopCompile.
EDIT: I tried removing most of those myself in the source code, and the britgas Hessian latency remains unchanged.
To reproduce, start a Julia REPL with
julia --startup-file="no"
then run
Here are the results, with the most important invalidations printed last (do it in your terminal you'll have colored outputs)
The text was updated successfully, but these errors were encountered: