JuliaLang / JuliaLang/LinearAlgebra.jl

ldiv! with transpose uses less allocations than ldiv!

Open
#618 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
77
Forks
65
Avg merge
3d 23h
Merged PRs (30d)
10

Description

ldiv! with transposed LU factors uses less allocations and ldiv! with the original LU factors. For example,

julia> VERSION
v"1.2.0-DEV.487"

julia> using LinearAlgebra, BenchmarkTools

julia> A = rand(3,3); b = rand(3); x = rand(3); F = lu(A);

julia> @btime ldiv!($x, $F, $b);
  169.591 ns (3 allocations: 160 bytes)

julia> @btime ldiv!($x, transpose($F), $b);
  103.688 ns (0 allocations: 0 bytes)

Is this expected behavior?

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

Start by reproducing the two ldiv! benchmarks from the issue with Julia, LinearAlgebra, and BenchmarkTools, then compare the allocation behavior of the original and transposed LU-factor paths. Done means establishing whether the allocation difference is expected and, if not, identifying the relevant implementation or test location for a fix.

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
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.