@@ -5,6 +5,7 @@ using Boltz, Lux, Random
55
66const SUITE = BenchmarkGroup ()
77
8+ SUITE[" runtime" ] = BenchmarkGroup ()
89SUITE[" comptime" ] = BenchmarkGroup ()
910
1011SUITE[" comptime" ][" basics" ] = BenchmarkGroup ()
@@ -20,18 +21,53 @@ end setup = begin
2021 a = Reactant. ConcreteRArray (ones (2 , 10 ))
2122end
2223
24+ SUITE[" runtime" ][" lux neural networks" ] = BenchmarkGroup ()
2325SUITE[" comptime" ][" lux neural networks" ] = BenchmarkGroup ()
2426
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) )
3032 ps, st = Lux. setup (Random. default_rng (), vgg)
3133 ps_concrete = Reactant. to_rarray (ps)
3234 st_concrete = Reactant. to_rarray (Lux. testmode (st))
3335 x = Reactant. to_rarray (rand (Float32, 224 , 224 , 3 , 16 ))
3436 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
3571end
3672
3773function sumcos (x)
0 commit comments