-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #574 from LuxDL/ap/more_bench
Add more benchmarks
- Loading branch information
Showing
5 changed files
with
38 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
function add_dense_benchmarks!() | ||
for n in (2, 20, 200, 2000) | ||
layer = Dense(n => n) | ||
x, ps, st = general_setup(layer, (n, 128)) | ||
benchmark_forward_pass("Dense($n => $n)", "($n, 128)", layer, x, ps, st) | ||
end | ||
|
||
return | ||
end | ||
|
||
function add_conv_benchmarks!() | ||
for ch in (1, 3, 16, 64) | ||
layer = Conv((3, 3), ch => ch) | ||
x, ps, st = general_setup(layer, (64, 64, ch, 128)) | ||
benchmark_forward_pass( | ||
"Conv((3, 3), $ch => $ch)", "(64, 64, $ch, 128)", layer, x, ps, st) | ||
end | ||
end | ||
|
||
add_dense_benchmarks!() | ||
add_conv_benchmarks!() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1a9b75f
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.
Benchmark Results
Dense(2 => 2)/cpu/forward/NamedTuple/(2, 128)
1984.7
nsDense(2 => 2)/cpu/forward/ComponentArray/(2, 128)
1575.5290322580645
nsDense(20 => 20)/cpu/forward/NamedTuple/(20, 128)
4986.428571428572
nsDense(20 => 20)/cpu/forward/ComponentArray/(20, 128)
4844.857142857143
nsConv((3, 3), 3 => 3)/cpu/forward/NamedTuple/(64, 64, 3, 128)
10196460
nsConv((3, 3), 3 => 3)/cpu/forward/ComponentArray/(64, 64, 3, 128)
10205231
nsvgg16/cpu/forward/NamedTuple/(32, 32, 3, 1)
22651130
nsvgg16/cpu/forward/NamedTuple/(32, 32, 3, 16)
247269307
nsvgg16/cpu/forward/NamedTuple/(32, 32, 3, 64)
976864795
nsvgg16/cpu/forward/ComponentArray/(32, 32, 3, 1)
22574572
nsvgg16/cpu/forward/ComponentArray/(32, 32, 3, 16)
247323972
nsvgg16/cpu/forward/ComponentArray/(32, 32, 3, 64)
980528339
nsConv((3, 3), 64 => 64)/cpu/forward/NamedTuple/(64, 64, 64, 128)
376148743
nsConv((3, 3), 64 => 64)/cpu/forward/ComponentArray/(64, 64, 64, 128)
376204608
nsConv((3, 3), 1 => 1)/cpu/forward/NamedTuple/(64, 64, 1, 128)
3865836
nsConv((3, 3), 1 => 1)/cpu/forward/ComponentArray/(64, 64, 1, 128)
3868454.5
nsDense(200 => 200)/cpu/forward/NamedTuple/(200, 128)
87364
nsDense(200 => 200)/cpu/forward/ComponentArray/(200, 128)
87103
nsConv((3, 3), 16 => 16)/cpu/forward/NamedTuple/(64, 64, 16, 128)
55595252
nsConv((3, 3), 16 => 16)/cpu/forward/ComponentArray/(64, 64, 16, 128)
55637334
nsDense(2000 => 2000)/cpu/forward/NamedTuple/(2000, 128)
6529154
nsDense(2000 => 2000)/cpu/forward/ComponentArray/(2000, 128)
6510786
nsThis comment was automatically generated by workflow using github-action-benchmark.