TuringLang / EllipticalSliceSampling.jl

Julia implementation of elliptical slice sampling.
https://turinglang.org/EllipticalSliceSampling.jl/
MIT License
13 stars 5 forks source link

Use more lightweight ArrayInterfaceCore, drop Julia < 1.6, and release ESS 1.0.0 #29

Closed devmotion closed 2 years ago

devmotion commented 2 years ago

With Julia 1.8 beta3 the following improvement can be observed:

Latest release

julia> @time_imports using EllipticalSliceSampling
     26.9 ms    ┌ MacroTools
     45.5 ms  ┌ ZygoteRules
     23.8 ms          ┌ Preferences
     24.6 ms        ┌ JLLWrappers
     30.7 ms      ┌ Rmath_jll
    121.2 ms    ┌ Rmath
      4.1 ms    ┌ Compat
      0.5 ms    ┌ NaNMath
      2.7 ms    ┌ Calculus
     70.6 ms        ┌ ChainRulesCore
     71.8 ms      ┌ ChangesOfVariables
      1.1 ms      ┌ OpenLibm_jll
      1.9 ms      ┌ InverseFunctions
      5.4 ms      ┌ DocStringExtensions
      5.2 ms      ┌ IrrationalConstants
      0.7 ms      ┌ CompilerSupportLibraries_jll
      1.4 ms        ┌ LogExpFunctions
      0.9 ms        ┌ OpenSpecFun_jll
     18.7 ms      ┌ SpecialFunctions
     16.5 ms      ┌ DualNumbers
    123.9 ms    ┌ HypergeometricFunctions
      0.3 ms    ┌ Reexport
    264.0 ms  ┌ StatsFuns
      0.4 ms  ┌ DefineSingletons
      0.2 ms    ┌ IteratorInterfaceExtensions
      0.6 ms  ┌ TableTraits
      8.1 ms    ┌ OrderedCollections
      0.5 ms    ┌ Requires
      0.2 ms    ┌ DataValueInterfaces
      1.5 ms      ┌ DataAPI
     15.6 ms    ┌ Tables
      1.2 ms    ┌ ConstructionBase
     31.2 ms    ┌ Setfield
     31.0 ms    ┌ InitialValues
    136.5 ms  ┌ BangBang
     72.8 ms  ┌ DataStructures
    171.5 ms  ┌ FillArrays
      0.6 ms    ┌ StatsAPI
      0.8 ms    ┌ SortingAlgorithms
      9.9 ms    ┌ Missings
     37.3 ms  ┌ StatsBase
     10.7 ms    ┌ MicroCollections
      0.7 ms    ┌ Adapt
      0.5 ms    ┌ ArgCheck
     10.6 ms    ┌ SplittablesBase
      0.3 ms    ┌ CompositionsBase
     30.2 ms    ┌ Baselet
    117.6 ms  ┌ Transducers
     25.0 ms  ┌ PDMats
      8.5 ms    ┌ AbstractTrees
      4.0 ms    ┌ ProgressLogging
      7.2 ms    ┌ LeftChildRightSiblingTrees
     21.6 ms  ┌ TerminalLoggers
      1.6 ms    ┌ DensityInterface
      4.0 ms    ┌ QuadGK
    224.6 ms  ┌ Distributions
      0.3 ms  ┌ IfElse
     47.3 ms    ┌ Static
    589.7 ms  ┌ ArrayInterface
      7.4 ms  ┌ ProgressMeter
      3.0 ms  ┌ LoggingExtras
      1.1 ms  ┌ ConsoleProgressMonitor
      5.5 ms  ┌ AbstractMCMC
   1735.4 ms  EllipticalSliceSampling

This PR

julia> @time_imports using EllipticalSliceSampling
     26.7 ms    ┌ MacroTools
     45.3 ms  ┌ ZygoteRules
     27.3 ms          ┌ Preferences
     28.2 ms        ┌ JLLWrappers
     33.1 ms      ┌ Rmath_jll
    119.6 ms    ┌ Rmath
      3.0 ms    ┌ Compat
      0.6 ms    ┌ NaNMath
      2.7 ms    ┌ Calculus
     71.7 ms        ┌ ChainRulesCore
     73.0 ms      ┌ ChangesOfVariables
      0.6 ms      ┌ OpenLibm_jll
      1.2 ms      ┌ InverseFunctions
      4.1 ms      ┌ DocStringExtensions
      5.7 ms      ┌ IrrationalConstants
      0.7 ms      ┌ CompilerSupportLibraries_jll
      1.3 ms        ┌ LogExpFunctions
      0.9 ms        ┌ OpenSpecFun_jll
     17.4 ms      ┌ SpecialFunctions
     15.9 ms      ┌ DualNumbers
    120.9 ms    ┌ HypergeometricFunctions
      0.3 ms    ┌ Reexport
    257.0 ms  ┌ StatsFuns
      0.3 ms  ┌ DefineSingletons
      0.2 ms    ┌ IteratorInterfaceExtensions
      0.5 ms  ┌ TableTraits
      8.2 ms    ┌ OrderedCollections
      0.6 ms    ┌ Requires
      0.2 ms    ┌ DataValueInterfaces
      1.2 ms      ┌ DataAPI
     15.3 ms    ┌ Tables
      1.1 ms    ┌ ConstructionBase
     31.0 ms    ┌ Setfield
     30.0 ms    ┌ InitialValues
    134.9 ms  ┌ BangBang
     72.1 ms  ┌ DataStructures
    170.9 ms  ┌ FillArrays
      0.6 ms    ┌ StatsAPI
      0.9 ms    ┌ SortingAlgorithms
      9.9 ms    ┌ Missings
     36.7 ms  ┌ StatsBase
     10.9 ms    ┌ MicroCollections
      0.7 ms    ┌ Adapt
      0.6 ms    ┌ ArgCheck
     10.8 ms    ┌ SplittablesBase
      0.3 ms    ┌ CompositionsBase
     29.6 ms    ┌ Baselet
    116.9 ms  ┌ Transducers
     24.7 ms  ┌ PDMats
      8.4 ms    ┌ AbstractTrees
      4.1 ms    ┌ ProgressLogging
      7.4 ms    ┌ LeftChildRightSiblingTrees
     21.7 ms  ┌ TerminalLoggers
      1.6 ms    ┌ DensityInterface
      3.6 ms    ┌ QuadGK
    223.8 ms  ┌ Distributions
      7.0 ms  ┌ ProgressMeter
      3.1 ms  ┌ LoggingExtras
      1.5 ms  ┌ ArrayInterfaceCore
      1.0 ms  ┌ ConsoleProgressMonitor
      5.7 ms  ┌ AbstractMCMC
   1128.4 ms  EllipticalSliceSampling

Since ArrayInterfaceCore only supports Julia >= 1.6, support for older Julia versions is removed. To be able to backport fixes and to follow the Julia Registry docs, hence a breaking new release is required. Since the package has been quite stable for some time, I guess it could be a good opportunity to release 1.0.0. In most cases it shouldn't make a difference whether we release 0.6 or 1 but with 1.0.0 we will be able to distinguish between feature and bugfix releases and can remove support for older Julia versions in a new (non-breaking) minor release instead.

codecov[bot] commented 2 years ago

Codecov Report

Merging #29 (79556ba) into main (5663030) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main      #29   +/-   ##
=======================================
  Coverage   94.91%   94.91%           
=======================================
  Files           3        3           
  Lines          59       59           
=======================================
  Hits           56       56           
  Misses          3        3           
Impacted Files Coverage Δ
src/abstractmcmc.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5663030...79556ba. Read the comment docs.