JuliaDiff / JuliaDiff/ChainRules.jl

(Re)use factorizations in primal for \ etc in pullback

Open
#250 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

performance
Dominant language
Julia
Stars
475
Forks
98
PR merge metrics
No merged PRs in 30d

Description

Transferred from https://github.com/FluxML/Zygote.jl/issues/773

There are some adjoints which repeat calculations in the backwards pass which can be avoided, for example.

https://github.com/JuliaDiff/ChainRules.jl/blob/bb08bd80b5cee92947002547de1f54556a5e3ee7/src/rulesets/LinearAlgebra/dense.jl#L284-L310
This refactorizes A' and can be replaced with factorize and use that in the backwards pass

Cc @oxinabox

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/rulesets/LinearAlgebra/dense.jl at the cited lines and inspect how the adjoint currently refactorizes A'. Trace the backward pass and identify the existing factorization path; done means the repeated factorization is avoided and the same result is preserved for the affected pullback rules.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.