JuliaDiff / JuliaDiff/AbstractDifferentiation.jl
Handling of thunks and tangents
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 138
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
When the VJP is not an abstract array, things get weird
julia> import AbstractDifferentiation as AD
julia> import Zygote
julia> ad_backend = AD.ReverseRuleConfigBackend(Zygote.ZygoteRuleConfig())
AbstractDifferentiation.ReverseRuleConfigBackend{Zygote.ZygoteRuleConfig{Zygote.Context{false}}}(Zygote.ZygoteRuleConfig{Zygote.Context{false}}(Zygote.Context{false}(nothing)))
julia> AD.second_derivative(ad_backend, identity, 1)
ERROR: MethodError: no method matching length(::ChainRulesCore.NoTangent)
julia> AD.hessian(ad_backend, sum, [1.0])
ERROR: MethodError: no method matching size(::ChainRulesCore.Thunk{ChainRulesCore.var"#48#49"{ChainRulesCore.Thunk{ChainRulesCore.var"#48#49"{…}}}})
Contributor guide
No contributing guide indexed for this repository
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 reproducing the two Julia examples in this issue, using AD.second_derivative and AD.hessian with ReverseRuleConfigBackend and Zygote. Trace how the reported NoTangent and Thunk values are handled; done should include behavior that no longer raises the shown length/size MethodErrors, with regression coverage for both cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend-api-design, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100