-
Notifications
You must be signed in to change notification settings - Fork 49
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
Loading ReverseDiff and UnicodePlots together and looking at their invalidations prints tens of thousands of lines #362
Comments
I have another case where it prints
maybe these should be collapsed somehow since they are identical? |
This is a tough case. First, I clearly have somewhat different data from you, not sure the reason, but don't expect an exact match to the specific numbers you show above. I've only made partial progress. For me, bad things start to happen at julia> invalidations[8041:8044]
4-element Vector{Any}:
MethodInstance for Base.Broadcast.materialize(::Base.Broadcast.Broadcasted{_A, Nothing} where _A<:Union{Nothing, Base.Broadcast.BroadcastStyle})
"insert_backedges_callee"
730
Any[materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(SpecialFunctions.bessely), var"#s32"} where var"#s32"<:Tuple{Rational, ReverseDiff.TrackedArray}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:290, materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(SpecialFunctions.bessely), var"#s31"} where var"#s31"<:Tuple{ReverseDiff.TrackedArray, Rational}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:291, materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(SpecialFunctions.bessely), var"#s32"} where var"#s32"<:Tuple{BigFloat, ReverseDiff.TrackedArray}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:290, materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(SpecialFunctions.bessely), var"#s31"} where var"#s31"<:Tuple{ReverseDiff.TrackedArray, BigFloat}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:291, materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(SpecialFunctions.bessely), var"#s32"} where var"#s32"<:Tuple{BigInt, ReverseDiff.TrackedArray}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:290, materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(SpecialFunctions.bessely), var"#s31"} where var"#s31"<:Tuple{ReverseDiff.TrackedArray, BigInt}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:291, materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(SpecialFunctions.bessely), var"#s32"} where var"#s32"<:Tuple{AbstractFloat, ReverseDiff.TrackedArray}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:290, materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(SpecialFunctions.bessely), var"#s31"} where var"#s31"<:Tuple{ReverseDiff.TrackedArray, AbstractFloat}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:291, materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(SpecialFunctions.bessely), var"#s32"} where var"#s32"<:Tuple{ForwardDiff.Dual, ReverseDiff.TrackedArray}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:290, materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(SpecialFunctions.bessely), var"#s31"} where var"#s31"<:Tuple{ReverseDiff.TrackedArray, ForwardDiff.Dual}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:291 … materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(min), var"#s28"} where var"#s28"<:Tuple{AbstractVector{<:Number}, ReverseDiff.TrackedReal}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:284, materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(min), var"#s30"} where var"#s30"<:Tuple{ReverseDiff.TrackedReal, ReverseDiff.TrackedArray}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:278, materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(min), var"#s32"} where var"#s32"<:Tuple{Real, ReverseDiff.TrackedArray}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:290, materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(min), var"#s26"} where var"#s26"<:Tuple{ReverseDiff.TrackedReal, AbstractMatrix{<:Number}}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:285, materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(min), var"#s26"} where var"#s26"<:Tuple{ReverseDiff.TrackedReal, AbstractVector{<:Number}}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:285, materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(min), var"#s30"} where var"#s30"<:Tuple{ReverseDiff.TrackedArray, AbstractArray{<:Number}}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:283, materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(min), var"#s28"} where var"#s28"<:Tuple{AbstractArray{<:Number}, ReverseDiff.TrackedReal}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:284, materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(min), var"#s26"} where var"#s26"<:Tuple{ReverseDiff.TrackedReal, AbstractArray{<:Number}}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:285, materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(min), var"#s32"} where var"#s32"<:Tuple{AbstractVector{<:Number}, ReverseDiff.TrackedArray}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:282, materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(min), var"#s32"} where var"#s32"<:Tuple{AbstractArray{<:Number}, ReverseDiff.TrackedArray}) @ ReverseDiff ~/.julia/packages/ReverseDiff/Zu4v6/src/derivatives/broadcast.jl:282] That list of Interpretation: starting at the top (i.e., index 8041 in MethodInstance for Base.Broadcast.materialize(::Base.Broadcast.Broadcasted{_A, Nothing} where _A<:Union{Nothing, Base.Broadcast.BroadcastStyle}) was the signature we had been compiled to call, and that signature now matches 2037 Methods. The julia> sum((==).(invalidations, 730))
16 means that there were 15 dependents. So the reason you get so much output is that any of those 2037 Methods could have invalidated the same 15 dependents. Thus you get >2037 separate SnoopCompile.jl/src/invalidations.jl Lines 482 to 484 in 0d84aed
The design of SnoopCompile, where each inserted method is the root of a tree of invalidations, is not well-suited to the case where there are large numbers of effectively-identical causes for the same set of invalidations. |
For reference, here are the number of "excess" (unexpected) matching methods for each case of edge-validation failure: 9-element Vector{Int64}:
2
2
47
2
2
2037
2037
2
8 So most are quite short. The one with 47 is also MethodInstance for Base.Broadcast.materialize(::Base.Broadcast.Broadcasted{_A, Nothing, typeof(/)} where _A<:Union{Nothing, Base.Broadcast.BroadcastStyle}) as the intended signature. The rest are all |
should probably be collapsed somehow. Also I don't really understand where this many methods can come from:
The text was updated successfully, but these errors were encountered: