-
Notifications
You must be signed in to change notification settings - Fork 56
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
Improved the dot product between two vectors and a sparse matrix #410
Conversation
For the moment I left the check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. A few comments.
Good point. Let's assume that for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be interesting to see the timings now without the zero-test.
Co-authored-by: Daniel Karrasch <[email protected]>
N1 = 1024*20
N2 = 1024*40
T = Float64
x = rand(T, N1)
y = rand(T, N2)
@benchmark dot($x, $A, $y)
BenchmarkTools.Trial: 10000 samples with 1 evaluation.
Range (min … max): 261.300 μs … 1.293 ms ┊ GC (min … max): 0.00% … 0.00%
Time (median): 293.500 μs ┊ GC (median): 0.00%
Time (mean ± σ): 322.014 μs ± 70.194 μs ┊ GC (mean ± σ): 0.00% ± 0.00%
▂▂██▆▅▆▅▅▄▄▄▃▄▃▃▂▂▂▂▂▂▂▂▂▂▂▂▁▁ ▁▁▁▁▁ ▁▁ ▂
██████████████████████████████████████████▇█████▇▇█▇▆▇▇▇▆▆▅▆ █
261 μs Histogram: log(frequency) by time 575 μs <
Memory estimate: 0 bytes, allocs estimate: 0.
@benchmark mydot($x, $A, $y)
BenchmarkTools.Trial: 10000 samples with 1 evaluation.
Range (min … max): 213.700 μs … 743.500 μs ┊ GC (min … max): 0.00% … 0.00%
Time (median): 233.200 μs ┊ GC (median): 0.00%
Time (mean ± σ): 245.754 μs ± 40.873 μs ┊ GC (mean ± σ): 0.00% ± 0.00%
▄▆▅███▇▇▅▅▄▃▃▂▁▂▂▁ ▁▁ ▂
████████████████████████████████▇▇████▇██▇▆▇▆▆▆▇▇▆▆▆▆▆▆▅▅▆▅▅▄ █
214 μs Histogram: log(frequency) by time 428 μs <
Memory estimate: 0 bytes, allocs estimate: 0. |
Codecov Report
@@ Coverage Diff @@
## main #410 +/- ##
==========================================
+ Coverage 92.42% 93.20% +0.78%
==========================================
Files 12 12
Lines 7666 7666
==========================================
+ Hits 7085 7145 +60
+ Misses 581 521 -60
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more 📢 Have feedback on the report? Share it here. |
I think it is finished. The codecov is decreased because the amount of lines is less. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last detail I noticed, but afterwards we should really finally merge this.
The changed function is a little bit faster than the current one.
And with vectors without zeros: