JuliaDiff / JuliaDiff/ForwardDiff.jl
More memory allocated after update to Julia 1.6.1
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 1k
- Forks
- 160
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to figure out why a code of mine allocates twice the amount of memory and takes twice as long after updating to 1.6.1 (from 1.5.4). One of the lines thats allocating more memory (according to the profile) is the call to ForwardDiff.hessian!. I haven't managed to reproduce this in an MWE, however, this simple code
using ForwardDiff
using BenchmarkTools
using LinearAlgebra
f(C,ε) = (C*ε)⋅ε
ε = rand(6)
C = rand(6,6)
@btime ForwardDiff.hessian!(out, x->f($C,x), $ε) setup=(out = DiffResults.HessianResult(ε))
also results in more memory being allocated on 1.6.1
----------------
1.5
----------------
3.191 μs (12 allocations: 8.28 KiB)
----------------
1.6
----------------
3.973 μs (11 allocations: 13.31 KiB)
Any ideas what could cause that. That difference is not as large as the one I see in the profiler (there it's about 7 times more memory allocation for 1.6) though.
Version: ForwardDiff v0.10.18
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
Run the provided BenchmarkTools example with ForwardDiff.hessian! under Julia 1.5.4 and 1.6.1, comparing allocations and timing. Determine whether the regression is in ForwardDiff v0.10.18 or the Julia upgrade; done means a reproducible explanation or fix is established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100