• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

JuliaLang / julia / #37899
77%

Build:
DEFAULT BRANCH: master
Ran 10 Sep 2024 10:39AM UTC
Jobs 1
Files 361
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

10 Sep 2024 06:39AM UTC coverage: 87.749% (-0.009%) from 87.758%
#37899

push

local

web-flow
Avoid materializing arrays in bidiag matmul (#55450)

Currently, small `Bidiagonal`/`Tridiagonal` matrices are materialized in
matrix multiplications, but this is wasteful and unnecessary. This PR
changes this to use a naive matrix multiplication for small matrices,
and fall back to the banded multiplication for larger ones.
Multiplication by a `Bidiagonal` falls back to a banded matrix
multiplication for all sizes in the current implementation, and iterates
in a cache-friendly manner for the non-`Bidiagonal` matrix.

In certain cases, the matrices were being materialized if the
non-structured matrix was small, even if the structured matrix was
large. This is changed as well in this PR.

Some improvements in performance:
```julia
julia> B = Bidiagonal(rand(3), rand(2), :U); A = rand(size(B)...); C = similar(A);

julia> @btime mul!($C, $A, $B);
  193.152 ns (6 allocations: 352 bytes) # nightly v"1.12.0-DEV.1034"
  18.826 ns (0 allocations: 0 bytes) # This PR

julia> T = Tridiagonal(rand(99), rand(100), rand(99)); A = rand(2, size(T,2)); C = similar(A);

julia> @btime mul!($C, $A, $T);
  9.398 μs (8 allocations: 79.94 KiB) # nightly
  416.407 ns (0 allocations: 0 bytes) # This PR

julia> B = Bidiagonal(rand(300), rand(299), :U); A = rand(20000, size(B,2)); C = similar(A);

julia> @btime mul!($C, $A, $B);
  33.395 ms (0 allocations: 0 bytes) # nightly
  6.695 ms (0 allocations: 0 bytes) # This PR (cache-friendly)
```

Closes https://github.com/JuliaLang/julia/pull/55414

---------

Co-authored-by: Daniel Karrasch <daniel.karrasch@posteo.de>

241 of 241 new or added lines in 2 files covered. (100.0%)

394 existing lines in 11 files now uncovered.

78456 of 89410 relevant lines covered (87.75%)

16601480.8 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
98.7
-0.43% base/bitset.jl
1
97.33
0.52% stdlib/LinearAlgebra/src/bidiag.jl
1
89.76
0.0% base/compiler/tfuncs.jl
2
91.67
-1.85% stdlib/Markdown/src/parse/util.jl
2
85.96
-1.75% stdlib/Markdown/src/GitHub/table.jl
3
78.26
-13.04% base/locks-mt.jl
6
93.96
0.02% base/strings/io.jl
11
90.0
-5.79% stdlib/Markdown/src/Common/block.jl
14
94.19
-2.14% stdlib/LinearAlgebra/src/diagonal.jl
32
74.62
1.73% base/partr.jl
321
77.37
0.03% base/loading.jl
Jobs
ID Job ID Ran Files Coverage
1 #37899.1 10 Sep 2024 10:39AM UTC 361
87.75
Source Files on build #37899
  • Tree
  • List 361
  • Changed 238
  • Source Changed 0
  • Coverage Changed 13
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 7a645dd2 on github
  • Prev Build on master
  • Next Build on master
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc