Skip to content

Commit 8422479

Browse files
committed
use in-place broadcasts for activations and don't force tuning
1 parent a4daf10 commit 8422479

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

benchmark/benchmarks.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ Random.seed!(1234567890)
88
const SUITE = BenchmarkGroup()
99

1010
SUITE["activations"] = BenchmarkGroup()
11-
let x = rand(64, 64)
12-
for f in NNlib.ACTIVATIONS
13-
act = @eval($f)
14-
SUITE["activations"][string(f)] = @benchmarkable $act.($x)
11+
for et in (Float16, Float32, Float64)
12+
et_suite = BenchmarkGroup()
13+
SUITE["activations"][string(et)] = et_suite
14+
let x = rand(et, 1024, 1024), y = similar(x)
15+
for f in NNlib.ACTIVATIONS
16+
act = @eval($f)
17+
et_suite[string(f)] = @benchmarkable broadcast!($act, $y, $x)
18+
end
1519
end
1620
end
1721

benchmark/runbenchmarks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function parse_commandline()
2424
default = "master"
2525
"--retune"
2626
help = "force re-tuning (ignore existing tuning data)"
27-
action = :store_true
27+
action = :store_false
2828
end
2929

3030
return parse_args(s)

0 commit comments

Comments
 (0)