JuliaDiff / JuliaDiff/ChainRules.jl

`rand!` is marked non-differentiable

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

Nobody has claimed this yet.

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

Description

This fallback method for rand in Distributions.jl hits this rule, which is declared non-differentiable.

This results in a silent failure, where there ought to be an error if the given AD (in my case Zygote), is unable to handle in-place differentiation.

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 with the fallback method linked in Distributions.jl's src/genericrand.jl and the random rule at src/rulesets/Random/random.jl. Reproduce the rand! differentiation case with an AD such as Zygote and trace why it is treated as non-differentiable. Done means the unsupported in-place differentiation case no longer fails silently and its behavior is covered by a regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.