EnzymeAD/Enzyme.jl

enzyme_sparse_accumulate and co in Julia

オープン

#1,947 opened on 2024/10/09

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)Julia (96 件のフォーク)batch import
help wanted

Repository metrics

Stars
 (563 個のスター)
PR merge metrics
 (平均マージ 5d 1h) (30d で 76 merged PRs)

説明

What would we need to do to define support for sparse operations/jacobians in Enzyme.jl?

using Enzyme
using SparseArrays

julia> Enzyme.jacobian(Enzyme.Forward, x->sum(abs2, x, dims=2), sprandn(12, 0.5))
12×12 Matrix{Float64}:
  0.0       0.0       0.0      0.0     0.0     0.0     0.0     0.0      0.0  0.0  0.0  0.0
 -1.88261  -1.88261   0.0      0.0     0.0     0.0     0.0     0.0      0.0  0.0  0.0  0.0
  0.0       0.0      -3.04331  0.0     0.0     0.0     0.0     0.0      0.0  0.0  0.0  0.0
  0.0       0.0       0.0      0.0     0.0     0.0     0.0     0.0      0.0  0.0  0.0  0.0
  0.0       0.0       0.0      0.0     0.0     0.0     0.0     0.0      0.0  0.0  0.0  0.0
  0.0       0.0       0.0      0.0     0.0     0.0     0.0     0.0      0.0  0.0  0.0  0.0
  0.0       0.0       0.0      1.2327  1.2327  1.2327  1.2327  0.0      0.0  0.0  0.0  0.0
  0.0       0.0       0.0      0.0     0.0     0.0     0.0     1.63961  0.0  0.0  0.0  0.0
  0.0       0.0       0.0      0.0     0.0     0.0     0.0     0.0      0.0  0.0  0.0  0.0
  0.0       0.0       0.0      0.0     0.0     0.0     0.0     0.0      0.0  0.0  0.0  0.0
  0.0       0.0       0.0      0.0     0.0     0.0     0.0     0.0      0.0  0.0  0.0  0.0
  0.0       0.0       0.0      0.0     0.0     0.0     0.0     0.0      0.0  0.0  0.0  0.0

コントリビューターガイド