-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: partial NNlib.gather support + better indexing support (#252)
* feat: unbreak NNlib.gather * feat: use dynamic slicing * chore: apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * feat: add an overload of Base.Tuple * fix: ambiguity error * feat: special case `gather!` for the most common cases * feat: optimize the special case of indexing with unitranges * test: dynamic slice test * test: port NNlib gather tests over * chore: apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: mark length as Int64 * fix: use the C API for dimension numbers
- Loading branch information
Showing
5 changed files
with
317 additions
and
38 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
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
Oops, something went wrong.
9d666f8
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.
Reactant.jl Benchmarks
ViT base (256 x 256 x 3 x 32)/forward/CPU/Reactant (optimize = :after_enzyme)
6791483981
ns5787425685
ns1.17
ViT base (256 x 256 x 3 x 32)/forward/CPU/Reactant
5758935576
ns5292258390
ns1.09
ViT base (256 x 256 x 3 x 32)/forward/CPU/Reactant (optimize = :before_enzyme)
5991010944
ns6086056532
ns0.98
ViT base (256 x 256 x 3 x 32)/forward/CPU/Reactant (optimize = :only_enzyme)
7226896499
ns7587601119
ns0.95
ViT base (256 x 256 x 3 x 32)/forward/CPU/Lux
35602806226
ns28087750784
ns1.27
ViT small (256 x 256 x 3 x 4)/forward/CPU/Reactant (optimize = :after_enzyme)
1554984111
ns1563822331
ns0.99
ViT small (256 x 256 x 3 x 4)/forward/CPU/Reactant
1544583024
ns1543677512
ns1.00
ViT small (256 x 256 x 3 x 4)/forward/CPU/Reactant (optimize = :before_enzyme)
1548949983
ns1553822136
ns1.00
ViT small (256 x 256 x 3 x 4)/forward/CPU/Reactant (optimize = :only_enzyme)
3305789982
ns3309603029
ns1.00
ViT small (256 x 256 x 3 x 4)/forward/CPU/Lux
2506900881
ns3236551447
ns0.77
ViT tiny (256 x 256 x 3 x 32)/forward/CPU/Reactant (optimize = :after_enzyme)
2135647085
ns2198150190
ns0.97
ViT tiny (256 x 256 x 3 x 32)/forward/CPU/Reactant
2114392785
ns2155687426
ns0.98
ViT tiny (256 x 256 x 3 x 32)/forward/CPU/Reactant (optimize = :before_enzyme)
2152785430
ns2192886728
ns0.98
ViT tiny (256 x 256 x 3 x 32)/forward/CPU/Reactant (optimize = :only_enzyme)
3920703119
ns3908194881
ns1.00
ViT tiny (256 x 256 x 3 x 32)/forward/CPU/Lux
6189728956.5
ns5993416352
ns1.03
ViT tiny (256 x 256 x 3 x 4)/forward/CPU/Reactant (optimize = :after_enzyme)
1457078887
ns1406808783.5
ns1.04
ViT tiny (256 x 256 x 3 x 4)/forward/CPU/Reactant
1444716715
ns1407299141
ns1.03
ViT tiny (256 x 256 x 3 x 4)/forward/CPU/Reactant (optimize = :before_enzyme)
1436557810
ns1410969730
ns1.02
ViT tiny (256 x 256 x 3 x 4)/forward/CPU/Reactant (optimize = :only_enzyme)
3216204610
ns3156311368
ns1.02
ViT tiny (256 x 256 x 3 x 4)/forward/CPU/Lux
1056965356.5
ns1099155376.5
ns0.96
ViT tiny (256 x 256 x 3 x 16)/forward/CPU/Reactant (optimize = :after_enzyme)
1742579811
ns1727787162
ns1.01
ViT tiny (256 x 256 x 3 x 16)/forward/CPU/Reactant
1724456565
ns1727804980
ns1.00
ViT tiny (256 x 256 x 3 x 16)/forward/CPU/Reactant (optimize = :before_enzyme)
1703597363
ns1711663111
ns1.00
ViT tiny (256 x 256 x 3 x 16)/forward/CPU/Reactant (optimize = :only_enzyme)
3527083552
ns3460051766
ns1.02
ViT tiny (256 x 256 x 3 x 16)/forward/CPU/Lux
3168974882.5
ns3010659432
ns1.05
ViT small (256 x 256 x 3 x 16)/forward/CPU/Reactant (optimize = :after_enzyme)
2194009586
ns2148427239
ns1.02
ViT small (256 x 256 x 3 x 16)/forward/CPU/Reactant
2185020760
ns2170426380
ns1.01
ViT small (256 x 256 x 3 x 16)/forward/CPU/Reactant (optimize = :before_enzyme)
2145844912
ns2187259107
ns0.98
ViT small (256 x 256 x 3 x 16)/forward/CPU/Reactant (optimize = :only_enzyme)
3888344576
ns3958804601
ns0.98
ViT small (256 x 256 x 3 x 16)/forward/CPU/Lux
5917571640
ns6647100753
ns0.89
ViT small (256 x 256 x 3 x 32)/forward/CPU/Reactant (optimize = :after_enzyme)
2952461976
ns3146044029
ns0.94
ViT small (256 x 256 x 3 x 32)/forward/CPU/Reactant
3000541626
ns3146912971
ns0.95
ViT small (256 x 256 x 3 x 32)/forward/CPU/Reactant (optimize = :before_enzyme)
3037769031
ns3047329260
ns1.00
ViT small (256 x 256 x 3 x 32)/forward/CPU/Reactant (optimize = :only_enzyme)
5003447240
ns4862728550
ns1.03
ViT small (256 x 256 x 3 x 32)/forward/CPU/Lux
16939295133
ns12794226734
ns1.32
ViT base (256 x 256 x 3 x 16)/forward/CPU/Reactant (optimize = :after_enzyme)
3182179123
ns3132478421
ns1.02
ViT base (256 x 256 x 3 x 16)/forward/CPU/Reactant
3260047692
ns3179953038
ns1.03
ViT base (256 x 256 x 3 x 16)/forward/CPU/Reactant (optimize = :before_enzyme)
3279955673
ns3185074336
ns1.03
ViT base (256 x 256 x 3 x 16)/forward/CPU/Reactant (optimize = :only_enzyme)
5217808864
ns5092564084
ns1.02
ViT base (256 x 256 x 3 x 16)/forward/CPU/Lux
13308548315
ns12253319305
ns1.09
ViT base (256 x 256 x 3 x 4)/forward/CPU/Reactant (optimize = :after_enzyme)
1848723326
ns1855345054
ns1.00
ViT base (256 x 256 x 3 x 4)/forward/CPU/Reactant
1856209821
ns1849809131
ns1.00
ViT base (256 x 256 x 3 x 4)/forward/CPU/Reactant (optimize = :before_enzyme)
1839420405
ns1855337197
ns0.99
ViT base (256 x 256 x 3 x 4)/forward/CPU/Reactant (optimize = :only_enzyme)
3618461240
ns3604644289
ns1.00
ViT base (256 x 256 x 3 x 4)/forward/CPU/Lux
3120647639.5
ns5868629461.5
ns0.53
This comment was automatically generated by workflow using github-action-benchmark.