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

Refs for BLAS calls causes performance hit for small matrices. #220

Closed
KristofferC opened this issue Jun 12, 2015 · 7 comments
Closed

Refs for BLAS calls causes performance hit for small matrices. #220

KristofferC opened this issue Jun 12, 2015 · 7 comments
Labels
performance Must go faster

Comments

@KristofferC
Copy link
Member

With this benchmark:

function mmult(N, n)
    A = rand(n,n)
    B = similar(A)
    @time for i = 1:N
        A_mul_B!(B, A, A)
    end
end

I get the following on master:

julia> mmult(10^6, 6)
 621.537 milliseconds (10000 k allocations: 153 MB, 0.90% gc time)

With JuliaLang/julia@62e5942 reverted:

julia> mmult(10^6, 6)
 208.683 milliseconds

Sort of dup of JuliaLang/julia#11531 except this is in Base. Imho it is not acceptable to double the time for matrix multiplication for smallish matrices.

@pao
Copy link
Member

pao commented Jun 12, 2015

cc @simonbyrne

@andreasnoack
Copy link
Member

@vtjnash Is this expected?

@jakebolewski
Copy link
Member

I would think that this is due mostly to Array construction being special cased in the system. I noticed a similar performance regression when the special casing of Expr object construction was removed.

@JeffBezanson
Copy link
Member

Doesn't it have to do with Refs being constructed, not Arrays?

@vtjnash
Copy link
Member

vtjnash commented Jun 12, 2015

it has to do with Ref objects being actually constructed rather than going through the painfully complex & handling (which does stack allocation).

this should be fixed by cleaning up JuliaLang/julia#8134 so it can be merged

@simonbyrne
Copy link
Contributor

We should probably revert the changes until JuliaLang/julia#8134 is fixed

KristofferC referenced this issue in KristofferC/julia Jun 14, 2015
This reverts commit 62e5942.

Fix #11681
@ViralBShah
Copy link
Member

+1 to reverting.

fcard referenced this issue in fcard/julia Jul 8, 2015
This reverts commit 62e5942.

Fix #11681
@KristofferC KristofferC transferred this issue from JuliaLang/julia Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster
Projects
None yet
Development

No branches or pull requests

8 participants