JuliaDiff / JuliaDiff/ChainRulesTestUtils.jl

Tests are slow: use vjvp ?

Open
#204 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
50
Forks
18
PR merge metrics
No merged PRs in 30d

Description

Compare Zygote's gradtest

julia> @btime gradtest(x -> sum(abs2, x), randn(4, 3, 2))
  17.977 μs (236 allocations: 5.86 KiB)

and CRTUs test_rrule

@btime test_rrule(Zygote.ZygoteRuleConfig(), x -> sum(abs2, x), randn(4, 3, 2); rrule_f=rrule_via_ad)
  1.490 ms (6884 allocations: 480.10 KiB)

it's nearly 100x slower. Do we understand why? I didn't have time to look into it so just making an issue.

ChainRules tests take a pretty long time to run so this might be worth improving.

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

No source file is named. Start by reproducing the @btime comparison between Zygote's gradtest and CRTU's test_rrule using rrule_via_ad, then trace the allocations and timing in the relevant test utilities. Done should include an explanation for the gap and, if practical, a measurable reduction in ChainRules test runtime.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
performance, testing-qa
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.