-
Notifications
You must be signed in to change notification settings - Fork 47
Minor findall and accumulate tests improvements
#592
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
Conversation
|
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/test/array.jl b/test/array.jl
index 81a676fe..bf36cad0 100644
--- a/test/array.jl
+++ b/test/array.jl
@@ -489,7 +489,7 @@ end
sum(reshape(PermutedDimsArray(reshape(Float32.(1:30), 5, 3, 2), (3, 1, 2)), (10, 3)); dims=1)
end
-@testset "accumulate" begin
+ @testset "accumulate" begin
for n in (0, 1, 2, 3, 10, 10_000, 16384, 16384+1) # small, large, odd & even, pow2 and not
@test testf(x->accumulate(+, x), rand(Float32, n))
@test testf(x->accumulate(+, x), rand(Float32, n, 2))
@@ -499,17 +499,18 @@ end
# multidimensional
for (sizes, dims) in ((2,) => 2,
(3,4,5) => 2,
- (1, 70, 50, 20) => 3,)
- @test testf(x->accumulate(+, x; dims=dims), rand(-10:10, sizes))
- @test testf(x->accumulate(+, x), rand(-10:10, sizes))
+ (1, 70, 50, 20) => 3,
+ )
+ @test testf(x -> accumulate(+, x; dims = dims), rand(-10:10, sizes))
+ @test testf(x -> accumulate(+, x), rand(-10:10, sizes))
end
# using initializer
for (sizes, dims) in ((2,) => 2,
(3,4,5) => 2,
(1, 70, 50, 20) => 3)
- @test testf(Base.Fix2((x,y)->accumulate(+, x; dims=dims, init=y), rand(-10:10)), rand(-10:10, sizes))
- @test testf(Base.Fix2((x,y)->accumulate(+, x; init=y), rand(-10:10)), rand(-10:10, sizes))
+ @test testf(Base.Fix2((x, y) -> accumulate(+, x; dims = dims, init = y), rand(-10:10)), rand(-10:10, sizes))
+ @test testf(Base.Fix2((x, y) -> accumulate(+, x; init = y), rand(-10:10)), rand(-10:10, sizes))
end
# in place |
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.
Metal Benchmarks
| Benchmark suite | Current: 4ef96cc | Previous: e1cb12e | Ratio |
|---|---|---|---|
private array/construct |
24534.666666666668 ns |
27902.666666666668 ns |
0.88 |
private array/broadcast |
462791.5 ns |
460708 ns |
1.00 |
private array/random/randn/Float32 |
797521.5 ns |
810625 ns |
0.98 |
private array/random/randn!/Float32 |
616021 ns |
625667 ns |
0.98 |
private array/random/rand!/Int64 |
566000 ns |
562334 ns |
1.01 |
private array/random/rand!/Float32 |
601292 ns |
587250 ns |
1.02 |
private array/random/rand/Int64 |
755354.5 ns |
754917 ns |
1.00 |
private array/random/rand/Float32 |
604084 ns |
599458 ns |
1.01 |
private array/copyto!/gpu_to_gpu |
664667 ns |
659417 ns |
1.01 |
private array/copyto!/cpu_to_gpu |
640500 ns |
663583 ns |
0.97 |
private array/copyto!/gpu_to_cpu |
814625 ns |
819292 ns |
0.99 |
private array/accumulate/1d |
1354104 ns |
1345688 ns |
1.01 |
private array/accumulate/2d |
1405958 ns |
1391125 ns |
1.01 |
private array/iteration/findall/int |
1825042 ns |
2092062 ns |
0.87 |
private array/iteration/findall/bool |
1583416.5 ns |
1848541 ns |
0.86 |
private array/iteration/findfirst/int |
1735833 ns |
1708834 ns |
1.02 |
private array/iteration/findfirst/bool |
1657375 ns |
1654125 ns |
1.00 |
private array/iteration/scalar |
3823354 ns |
3764584 ns |
1.02 |
private array/iteration/logical |
3001542 ns |
3206209 ns |
0.94 |
private array/iteration/findmin/1d |
1766750 ns |
1765979 ns |
1.00 |
private array/iteration/findmin/2d |
1366354.5 ns |
1359812.5 ns |
1.00 |
private array/reductions/reduce/1d |
1049645.5 ns |
1043000 ns |
1.01 |
private array/reductions/reduce/2d |
669208 ns |
652563 ns |
1.03 |
private array/reductions/mapreduce/1d |
1051958 ns |
1041334 ns |
1.01 |
private array/reductions/mapreduce/2d |
674708 ns |
664583 ns |
1.02 |
private array/permutedims/4d |
2508104 ns |
2485125 ns |
1.01 |
private array/permutedims/2d |
1029083 ns |
1017438 ns |
1.01 |
private array/permutedims/3d |
1606291.5 ns |
1574062 ns |
1.02 |
private array/copy |
617958 ns |
594000 ns |
1.04 |
latency/precompile |
9832282958 ns |
9800310667 ns |
1.00 |
latency/ttfp |
4090393458 ns |
4097349916 ns |
1.00 |
latency/import |
1285477312 ns |
1279086125 ns |
1.00 |
integration/metaldevrt |
717417 ns |
731938 ns |
0.98 |
integration/byval/slices=1 |
1595896 ns |
1554979 ns |
1.03 |
integration/byval/slices=3 |
10252312.5 ns |
8369583 ns |
1.22 |
integration/byval/reference |
1571833 ns |
1571292 ns |
1.00 |
integration/byval/slices=2 |
2767875 ns |
2549291.5 ns |
1.09 |
kernel/indexing |
460833.5 ns |
450459 ns |
1.02 |
kernel/indexing_checked |
464271 ns |
456000 ns |
1.02 |
kernel/launch |
9167 ns |
9173.666666666668 ns |
1.00 |
metal/synchronization/stream |
15000 ns |
14666 ns |
1.02 |
metal/synchronization/context |
15167 ns |
15209 ns |
1.00 |
shared array/construct |
24201.333333333332 ns |
25940.916666666664 ns |
0.93 |
shared array/broadcast |
459291.5 ns |
463250 ns |
0.99 |
shared array/random/randn/Float32 |
805500 ns |
609208.5 ns |
1.32 |
shared array/random/randn!/Float32 |
643334 ns |
620917 ns |
1.04 |
shared array/random/rand!/Int64 |
552979 ns |
574417 ns |
0.96 |
shared array/random/rand!/Float32 |
605083 ns |
587250 ns |
1.03 |
shared array/random/rand/Int64 |
833833 ns |
773125 ns |
1.08 |
shared array/random/rand/Float32 |
673250 ns |
624145.5 ns |
1.08 |
shared array/copyto!/gpu_to_gpu |
83584 ns |
82583 ns |
1.01 |
shared array/copyto!/cpu_to_gpu |
82666 ns |
83667 ns |
0.99 |
shared array/copyto!/gpu_to_cpu |
82792 ns |
78209 ns |
1.06 |
shared array/accumulate/1d |
1349292 ns |
1343937 ns |
1.00 |
shared array/accumulate/2d |
1397354 ns |
1399438 ns |
1.00 |
shared array/iteration/findall/int |
1825250 ns |
1832750 ns |
1.00 |
shared array/iteration/findall/bool |
1589292 ns |
1601500 ns |
0.99 |
shared array/iteration/findfirst/int |
1413124.5 ns |
1395458 ns |
1.01 |
shared array/iteration/findfirst/bool |
1376771 ns |
1370750.5 ns |
1.00 |
shared array/iteration/scalar |
159375 ns |
156875 ns |
1.02 |
shared array/iteration/logical |
2894750 ns |
2864083 ns |
1.01 |
shared array/iteration/findmin/1d |
1480562.5 ns |
1456833 ns |
1.02 |
shared array/iteration/findmin/2d |
1381042 ns |
1371916.5 ns |
1.01 |
shared array/reductions/reduce/1d |
732916.5 ns |
734750 ns |
1.00 |
shared array/reductions/reduce/2d |
665500 ns |
661500 ns |
1.01 |
shared array/reductions/mapreduce/1d |
740750 ns |
738375 ns |
1.00 |
shared array/reductions/mapreduce/2d |
677125 ns |
671833 ns |
1.01 |
shared array/permutedims/4d |
2545729.5 ns |
2532375 ns |
1.01 |
shared array/permutedims/2d |
1038375 ns |
1027125 ns |
1.01 |
shared array/permutedims/3d |
1593208 ns |
1577375 ns |
1.01 |
shared array/copy |
239750 ns |
251020.5 ns |
0.96 |
This comment was automatically generated by workflow using github-action-benchmark.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #592 +/- ##
==========================================
- Coverage 80.73% 80.67% -0.06%
==========================================
Files 61 61
Lines 2678 2681 +3
==========================================
+ Hits 2162 2163 +1
- Misses 516 518 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Things that should be merged from my struggle with #590.