EnzymeAD / EnzymeAD/Reactant.jl

Performance of Wrapped & Structured Arrays

Open
#373 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
370
Forks
74
Avg merge
18h 47m
Merged PRs (30d)
30

Description

## Problem Description

Currently, our approach to dealing with Wrapped Arrays is (considering the case of `mul!`:

```julia
function mul!(C::TracedRArray, B::AnyTracedRArray, A::AnyTracedRArray)
B = materialize_traced_array(B)
A = materialize_traced_array(A)
Ops.dot_general(....)
return C
end
```

This ensures that the code works as long as a wrapper type implements `materialize_traced_array`. But this is not the most efficient solution, trivial to see with the simple case of a `Diagonal` wrapper (see @mofeing's comment https://github.com/EnzymeAD/Reactant.jl/pull/369#issuecomment-2541402690 for implementation of `Diagonal` using `dot_general`)

## Current list of slow fallbacks

- [ ] `mul!`
- [ ] `diag`
- [ ] `diagm`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.