Real sparsity support in Enzyme backend
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 839
- Forks
- 100
- Avg merge
- 20h 43m
- Merged PRs (30d)
- 38
Description
Is your feature request related to a problem? Please describe.
The current Enyme implementation doesn't effectively leverage sparsity
Describe the solution you’d like
Something that looks like
if f.hess_prototype === nothing
vdθ = Tuple((similar(r) for r in eachrow(I(length(θ)) * 1.0)))
bθ = zeros(length(θ))
@show bθ
@show typeof(bθ)
vdbθ = Tuple(zeros(length(θ)) for i in eachindex(θ))
@show vdbθ
@show typeof(vdbθ)
else
θ = SparseArrays.sparse(θ)
@show θ
vdθ = Tuple((similar(SparseArrays.sparse(r)) for r in eachrow(I(length(θ)) * 1.0)))
@show vdθ
@show typeof(vdθ)
bθ = SparseArrays.similar(θ)
@show bθ
@show typeof(bθ)
vdbθ = Tuple(similar(i) for i in eachrow(f.hess_prototype))
@show vdbθ
@show typeof(vdbθ)
end
will need to be done
Describe alternatives you’ve considered
Maybe an automated sparsity detection version can exist as well but given recent benchmarking it is evident that this needs a rethinking of the way we are doing it
Additional context
Primary benchmark would be the cnlbeam one that already has a working Enzyme implementation. OPF might be worth revisiting with this as well.
cc: @wmoses I guess you'd be interested
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the current Enzyme backend and its handling of Hessian prototypes, then inspect the cnlbeam benchmark mentioned in the issue; OPF is a possible secondary case. Determine how sparse inputs and derivative containers should be represented, and validate the completed design against the cnlbeam benchmark with sparsity actually leveraged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100