Skip to content

[BREAKING] Move sparse functionality into package extensions #448

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 20 commits into from
Sep 5, 2024

Conversation

gdalle
Copy link
Member

@gdalle gdalle commented Sep 5, 2024

Warning

Breaking changes:

  • DenseSparsityDetector requires loading SparseArrays.jl
  • Sparse Jacobians and Hessians require loading SparseMatrixColorings.jl
  • GreedyColoringAlgorithm no longer re-exported from SparseMatrixColorings.jl

DI source

  • Remove dependency on SparseArrays and SparseMatrixColorings
  • Remove sparse AD functionalities

DI extensions

  • Add DISparseArraysExt for DenseSparsityDetector
  • Add DISparseMatrixColoringsExt for sparse Jacobians and Hessians

DI docs

  • Document the move to extensions

Load time before:

julia> @time_imports using DifferentiationInterface
      2.5 ms  ADTypes
      0.6 ms  Compat
      0.2 ms  Compat  CompatLinearAlgebraExt
               ┌ 0.0 ms DocStringExtensions.__init__() 
     38.3 ms  DocStringExtensions 96.38% compilation time
     51.8 ms  FillArrays
      0.2 ms  PackageExtensionCompat
               ┌ 0.8 ms SuiteSparse_jll.__init__() 
      1.1 ms  SuiteSparse_jll
               ┌ 5.9 ms SparseArrays.CHOLMOD.__init__() 95.92% compilation time
    151.7 ms  SparseArrays 3.76% compilation time
      2.3 ms  FillArrays  FillArraysSparseArraysExt
     25.3 ms  DataStructures
      1.3 ms  SparseMatrixColorings
               ┌ 0.0 ms DifferentiationInterface.__init__() 
      4.4 ms  DifferentiationInterface

Load time after:

julia> @time_imports using DifferentiationInterface
      2.9 ms  ADTypes
      0.5 ms  Compat
      0.2 ms  Compat  CompatLinearAlgebraExt
               ┌ 0.0 ms DocStringExtensions.__init__() 
     32.2 ms  DocStringExtensions 96.94% compilation time
     46.6 ms  FillArrays
      0.2 ms  PackageExtensionCompat
               ┌ 0.0 ms DifferentiationInterface.__init__() 
      3.1 ms  DifferentiationInterface

@codecov-commenter
Copy link

codecov-commenter commented Sep 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.53%. Comparing base (de23245) to head (2c97d9d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #448   +/-   ##
=======================================
  Coverage   98.53%   98.53%           
=======================================
  Files         105      107    +2     
  Lines        4293     4295    +2     
=======================================
+ Hits         4230     4232    +2     
  Misses         63       63           
Flag Coverage Δ
DI 98.68% <100.00%> (+<0.01%) ⬆️
DIT 98.22% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gdalle gdalle changed the title [BREAKING] Move sparse functionality into extensions [BREAKING] Move sparse functionality into package extensions Sep 5, 2024
@gdalle gdalle marked this pull request as ready for review September 5, 2024 07:56
@gdalle gdalle merged commit 1069266 into main Sep 5, 2024
60 of 105 checks passed
@gdalle gdalle deleted the gd/sparse_ext branch September 5, 2024 08:16
@gdalle gdalle mentioned this pull request Sep 5, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants