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

Improve inferrability of generic matrix-vector multiplication #36975

Merged
merged 1 commit into from
Aug 12, 2020

Conversation

chethega
Copy link
Contributor

@chethega chethega commented Aug 9, 2020

This hoists some work-arounds for computation of eltypes for zero-size vectors out of the loops in order to get a speedup in some cases where type inference otherwise takes tuple types.

Thanks to #36941 for opening the issue.

Before:

julia> using BenchmarkTools
julia> N = 100;
julia> x0 = ones(N);
julia> A_t = transpose(ones(Int64, N, 5*N));
julia> @btime $A_t * $x0;
  103.525 μs (1 allocation: 4.06 KiB)

After:

julia> @btime $A_t * $x0;
  34.917 μs (1 allocation: 4.06 KiB)

I put partial blame on #35164. I verified that #35163 stays fixed.

…e vectors out of the loops in order to get a speedup in some cases where type inference otherwise takes tuple types.
@JeffBezanson JeffBezanson merged commit 54d73a8 into JuliaLang:master Aug 12, 2020
KristofferC pushed a commit that referenced this pull request Aug 13, 2020
…e vectors out of the loops in order to get a speedup in some cases where type inference otherwise takes tuple types. (#36975)

(cherry picked from commit 54d73a8)
@KristofferC KristofferC mentioned this pull request Aug 13, 2020
25 tasks
KristofferC pushed a commit that referenced this pull request Aug 18, 2020
…e vectors out of the loops in order to get a speedup in some cases where type inference otherwise takes tuple types. (#36975)

(cherry picked from commit 54d73a8)
KristofferC pushed a commit that referenced this pull request Aug 19, 2020
…e vectors out of the loops in order to get a speedup in some cases where type inference otherwise takes tuple types. (#36975)

(cherry picked from commit 54d73a8)
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

Successfully merging this pull request may close these issues.

3 participants