@@ -5,6 +5,7 @@ using Boltz, Lux, Random
5
5
6
6
const SUITE = BenchmarkGroup ()
7
7
8
+ SUITE[" runtime" ] = BenchmarkGroup ()
8
9
SUITE[" comptime" ] = BenchmarkGroup ()
9
10
10
11
SUITE[" comptime" ][" basics" ] = BenchmarkGroup ()
@@ -20,18 +21,53 @@ end setup = begin
20
21
a = Reactant. ConcreteRArray (ones (2 , 10 ))
21
22
end
22
23
24
+ SUITE[" runtime" ][" lux neural networks" ] = BenchmarkGroup ()
23
25
SUITE[" comptime" ][" lux neural networks" ] = BenchmarkGroup ()
24
26
25
- for depth in [11 , 13 , 16 , 19 ]
26
- SUITE[" comptime" ][" lux neural networks" ][" vgg$depth " ] = @benchmarkable Reactant . compile (
27
- vgg, (x, ps_concrete, st_concrete)
28
- ) setup = begin
29
- vgg = Vision. VGG ($ depth; pretrained= false , batchnorm= false )
27
+ for depth in [11 , 13 , 16 , 19 ], batchnorm in [ false ,] # true] <-- not working yet
28
+ SUITE[" comptime" ][" lux neural networks" ][" vgg$( depth) bn= $(batchnorm) " ] = @benchmarkable begin
29
+ @compile vgg (x, ps_concrete, st_concrete)
30
+ end setup = begin
31
+ vgg = Vision. VGG ($ depth; pretrained= false , batchnorm= $ (batchnorm) )
30
32
ps, st = Lux. setup (Random. default_rng (), vgg)
31
33
ps_concrete = Reactant. to_rarray (ps)
32
34
st_concrete = Reactant. to_rarray (Lux. testmode (st))
33
35
x = Reactant. to_rarray (rand (Float32, 224 , 224 , 3 , 16 ))
34
36
end
37
+
38
+ SUITE[" runtime" ][" lux neural networks" ][" vgg$(depth) bn=$(batchnorm) (compiled)" ] = @benchmarkable begin
39
+ vgg_compiled (x, ps_concrete, st_concrete)
40
+ end setup = begin
41
+ vgg = Vision. VGG ($ depth; pretrained= false , batchnorm= $ (batchnorm))
42
+ ps, st = Lux. setup (Random. default_rng (), vgg)
43
+ ps_concrete = Reactant. to_rarray (ps)
44
+ st_concrete = Reactant. to_rarray (Lux. testmode (st))
45
+ x = Reactant. to_rarray (rand (Float32, 224 , 224 , 3 , 16 ))
46
+ vgg_compiled = @compile vgg (x, ps_concrete, st_concrete)
47
+ end
48
+ end
49
+
50
+ for version in (:tiny , :base )
51
+ SUITE[" comptime" ][" lux neural networks" ][" ViT $(version) " ] = @benchmarkable begin
52
+ @compile vit (x, ps_concrete, st_concrete)
53
+ end setup = begin
54
+ vit = Vision. ViT ($ (Meta. quot (version)))
55
+ ps, st = Lux. setup (Random. default_rng (), vit)
56
+ ps_concrete = Reactant. to_rarray (ps)
57
+ st_concrete = Reactant. to_rarray (Lux. testmode (st))
58
+ x = Reactant. to_rarray (rand (Float32, 256 , 256 , 3 , 16 ))
59
+ end
60
+
61
+ SUITE[" runtime" ][" lux neural networks" ][" ViT $(version) (compiled)" ] = @benchmarkable begin
62
+ vit_compiled (x, ps_concrete, st_concrete)
63
+ end setup = begin
64
+ vit = Vision. ViT ($ (Meta. quot (version)))
65
+ ps, st = Lux. setup (Random. default_rng (), vit)
66
+ ps_concrete = Reactant. to_rarray (ps)
67
+ st_concrete = Reactant. to_rarray (Lux. testmode (st))
68
+ x = Reactant. to_rarray (rand (Float32, 256 , 256 , 3 , 16 ))
69
+ vit_compiled = @compile vit (x, ps_concrete, st_concrete)
70
+ end
35
71
end
36
72
37
73
function sumcos (x)
0 commit comments