FluxML/Flux.jl

reducing invalidations

Open

#2080 aperta il 10 ott 2022

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)Julia (619 fork)batch import
help wanted

Metriche repository

Star
 (4725 star)
Metriche merge PR
 (Merge medio 4h 27m) (2 PR mergiate in 30 g)

Descrizione

using Flux entails a large number of invalidations:

julia> using SnoopCompileCore

julia> @snoopr using Flux
11604-element Vector{Any}:
  MethodInstance for setindex!(::Vector{AbstractString}, ::AbstractString, ::Int64)
 1
  MethodInstance for Base.rehash!(::Dict{Char, AbstractString}, ::Int64)
 2
  MethodInstance for Base.rehash!(::Dict{Char, AbstractString}, ::Int64)
 3
  MethodInstance for sizehint!(::Dict{Char, AbstractString}, ::Int64)
 3
  MethodInstance for Dict{Char, AbstractString}(::Pair{Char, String}, ::Vararg{Pair{Char, String}})
 4
 ⋮
  MethodInstance for Accessors.parse_obj_optics(::Symbol)
 1
  MethodInstance for Base.Broadcast.broadcasted(::Any, ::typeof(Accessors.lower_index), ::Base.RefValue, ::Any, ::Any)
  "jl_method_table_insert"
  MethodInstance for Setfield.parse_obj_lenses(::Any)
 1
  MethodInstance for Base.Broadcast.broadcasted(::Any, ::typeof(Setfield.lower_index), ::Base.RefValue, ::Any, ::Any)
  "jl_method_table_insert"
  broadcasted(f::Flux.Recur, args...) in Flux at /Users/carlo/.julia/packages/Flux/4k0Ls/src/deprecations.jl:20
  "jl_method_table_insert"

Whoever mastered the art of fixing invalidations is welcome to try and reduce them. We should filter out those due to dependencies.

Guida contributor