SciML / SciML/SparseWithDenseRowColMatrices.jl

Matrix-RHS adjoint/transpose matvec falls through to the generic dense fallback — ~3000x slowdown

Open
#8 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
0
Forks
1
Avg merge
14m
Merged PRs (30d)
6

Description

WHAT: Only vector adjoint/transpose mul! are defined (src/matvec.jl:163-171). mul!(Y, A', X) / A'*X for a matrix X dispatches to LinearAlgebra's generic fallback, which materializes columns of A' via getindex. Measured (n=5000, 10 cols): 17.4 s for 20 calls vs 0.0058 s for a structured per-column loop (bit-identical) — a 3007x slowdown. WHY IT MATTERS: This is the exact '~1000x slower' cliff the matvec.jl comment warns about, fixed for vectors but not matrices. Any block/multi-RHS adjoint (block iterative least squares, lstsq's A'*res on a matrix) silently hits it, and the gap went unnoticed because the adjoint matvec is untested (see the coverage issue). FIX: Add mul!(Y::AbstractMatrix, wA::Adjoint/Transpose{<:SparseWithDenseRowColMatrix}, X::AbstractMatrix, α, β) — a matrix analogue of _adjoint_matvec!: mul!(Y, Sop(A.S), X, α, β) then the rank-r block correction Y .+= α Vᴴ(Uᴴ X) (cheap r×ncols block, r≪n), plus the Base.:* matrix wrapper. EFFORT: S-M.


Priority: high. Filed from an automated next-steps audit of the QR/lstsq work (see PR #6).

Contributor guide

Open the contributing guide

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 in src/matvec.jl:163-171 and read _adjoint_matvec! to understand the existing vector path. Add the matrix mul! path for Adjoint/Transpose and the Base.:* wrapper described in the issue, then compare matrix-RHS results and performance with the structured per-column loop; done means avoiding the generic dense fallback while preserving bit-identical results.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
performance
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.