FluxML/Flux.jl

reducing invalidations

Open

#2.080 aberto em 10 de out. de 2022

Ver no GitHub
 (1 comment) (0 reactions) (0 assignees)Julia (619 forks)batch import
help wanted

Métricas do repositório

Stars
 (4.725 stars)
Métricas de merge de PR
 (Mesclagem média 4h 27m) (2 fundiu PRs em 30d)

Description

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.

Guia do colaborador