Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add blocksize keyword argument to qr[!] #33053

Merged
merged 1 commit into from Aug 26, 2019
Merged

Conversation

tkf
Copy link
Member

@tkf tkf commented Aug 24, 2019

A few quick benchmarks (see below) show that increasing block size helps when the matrix is not smalll. I propose to add a keyword argument blocksize to control it.

LAPACK.geqrt! with some large matrices

m = n = 10000

julia> @time LAPACK.geqrt!(randn(10000, 10000), 1000);
 12.204004 seconds (11 allocations: 915.528 MiB, 0.61% gc time)

julia> @time LAPACK.geqrt!(randn(10000, 10000), 100);
 13.498686 seconds (11 allocations: 778.199 MiB, 0.66% gc time)

julia> @time LAPACK.geqrt!(randn(10000, 10000), 50);
 17.521465 seconds (11 allocations: 770.569 MiB, 0.51% gc time)

julia> @time LAPACK.geqrt!(randn(10000, 10000), 36);
 21.275011 seconds (11 allocations: 768.433 MiB, 0.48% gc time)

m = n = 5000

julia> @time LAPACK.geqrt!(randn(5000, 5000), 1000);
  1.889297 seconds (11 allocations: 267.029 MiB)

julia> @time LAPACK.geqrt!(randn(5000, 5000), 100);
  1.908479 seconds (11 allocations: 198.365 MiB)

julia> @time LAPACK.geqrt!(randn(5000, 5000), 50);
  2.518595 seconds (11 allocations: 194.550 MiB)

julia> @time LAPACK.geqrt!(randn(5000, 5000), 36);
  2.854150 seconds (11 allocations: 193.482 MiB)

return qr!(AA, arg)
end
function qr(A::AbstractMatrix{T}) where T
function qr(A::AbstractMatrix{T}, arg...; kwargs...) where T
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qr(A::AbstractMatrix{T}, arg) and qr(A::AbstractMatrix{T}) had almost identical function body. I think vararg is a cleaner solution to make it DRY. What do you think?

@andreasnoack andreasnoack added linear algebra Linear algebra feature Indicates new feature / enhancement requests labels Aug 26, 2019
@andreasnoack andreasnoack merged commit 5e75cfe into JuliaLang:master Aug 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Indicates new feature / enhancement requests linear algebra Linear algebra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants