You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This looks fixed on current master. Re-running the exact benchmark from the report (A = PDMat(Matrix{Float64}(I, 250, 250)), x = rand(250), xd = ForwardDiff.Dual{Nothing}.(x)):
Float64
Dual
invquad
2064 B
2064 B
The dual path now matches the Float64 path, and allocation scales as O(n·#partials) rather than O(n²) — invquad/quad use the lazy chol_lower/chol_upper factors instead of M.chol.L/.U (which copy the factor). Added a regression test in #240.
Activity
mohdibntarek commentedon Jul 7, 2019
M.chol.Lseems to copy the array.M.chol.U'is faster and allocates less.mohdibntarek commentedon Jul 7, 2019
Not for the duals though. It seems that conversion happens for the generic fallback.
mohdibntarek commentedon Jul 7, 2019
In https://github.com/JuliaLang/julia/blob/df9210ebfb6d04832a2cbf1f44357c959a0b3457/stdlib/LinearAlgebra/src/triangular.jl#L1881, copying happens. I suppose this is necessary for BLAS calls, but when the
eltypeis the same asTABand for pure Julia implementations, this doesn't seem necessary IIUC.mohdibntarek commentedon Jul 7, 2019
It seems that copying here can be completely avoided since dispatch happens on
ldiv!anyways for BLAS types. But I may be wrong.devmotion commentedon Jun 25, 2026
This looks fixed on current
master. Re-running the exact benchmark from the report (A = PDMat(Matrix{Float64}(I, 250, 250)),x = rand(250),xd = ForwardDiff.Dual{Nothing}.(x)):Float64DualinvquadThe dual path now matches the
Float64path, and allocation scales as O(n·#partials) rather than O(n²) —invquad/quaduse the lazychol_lower/chol_upperfactors instead ofM.chol.L/.U(which copy the factor). Added a regression test in #240.Add ForwardDiff regression test for invquad/quad (issue #99) (#240)