FluxML/Flux.jl

reducing invalidations

Open

#2 080 ouverte le 10 oct. 2022

Voir sur GitHub
 (1 commentaire) (0 réactions) (0 assignés)Julia (619 forks)batch import
help wanted

Métriques du dépôt

Stars
 (4 725 stars)
Métriques de merge PR
 (Merge moyen 4h 27m) (2 PRs mergées en 30 j)

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.

Guide contributeur