Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AD Housekeeping #580

Merged
merged 3 commits into from
Apr 9, 2024
Merged

AD Housekeeping #580

merged 3 commits into from
Apr 9, 2024

Conversation

avik-pal
Copy link
Member

@avik-pal avik-pal commented Apr 9, 2024

  • Test if ChainRules problem is resolved
  • SimpleChains for multiple ad backends

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark Results

Benchmark suite Current: acb3b62 Previous: 2a20c5a Ratio
Dense(2 => 2)/cpu/reverse/ReverseDiff (compiled)/(2, 128) 3645.5 ns 3655.5 ns 1.00
Dense(2 => 2)/cpu/reverse/Zygote/(2, 128) 8373.916666666668 ns 8373.8 ns 1.00
Dense(2 => 2)/cpu/reverse/Tracker/(2, 128) 19356 ns 18875 ns 1.03
Dense(2 => 2)/cpu/reverse/ReverseDiff/(2, 128) 9758.2 ns 9946.6 ns 0.98
Dense(2 => 2)/cpu/reverse/Flux/(2, 128) 8842.6 ns 8994.5 ns 0.98
Dense(2 => 2)/cpu/reverse/SimpleChains/(2, 128) 4455.75 ns 4253.555555555556 ns 1.05
Dense(2 => 2)/cpu/forward/NamedTuple/(2, 128) 1996.8 ns 1996.7 ns 1.00
Dense(2 => 2)/cpu/forward/ComponentArray/(2, 128) 1656.1458333333333 ns 1654.0845070422536 ns 1.00
Dense(2 => 2)/cpu/forward/Flux/(2, 128) 1811.25 ns 1806.6203703703704 ns 1.00
Dense(2 => 2)/cpu/forward/SimpleChains/(2, 128) 179.88655462184875 ns 202.8326241134752 ns 0.89
Dense(20 => 20)/cpu/reverse/ReverseDiff (compiled)/(20, 128) 17543 ns 17643 ns 0.99
Dense(20 => 20)/cpu/reverse/Zygote/(20, 128) 18505 ns 18695 ns 0.99
Dense(20 => 20)/cpu/reverse/Tracker/(20, 128) 35446 ns 36698 ns 0.97
Dense(20 => 20)/cpu/reverse/ReverseDiff/(20, 128) 28393 ns 29145 ns 0.97
Dense(20 => 20)/cpu/reverse/Flux/(20, 128) 19727 ns 19827 ns 0.99
Dense(20 => 20)/cpu/reverse/SimpleChains/(20, 128) 17192 ns 16170 ns 1.06
Dense(20 => 20)/cpu/forward/NamedTuple/(20, 128) 4843.285714285715 ns 4955 ns 0.98
Dense(20 => 20)/cpu/forward/ComponentArray/(20, 128) 4876.285714285715 ns 5005.142857142857 ns 0.97
Dense(20 => 20)/cpu/forward/Flux/(20, 128) 4907.714285714285 ns 5036.714285714285 ns 0.97
Dense(20 => 20)/cpu/forward/SimpleChains/(20, 128) 1664.1 ns 1651.1 ns 1.01
Conv((3, 3), 3 => 3)/cpu/reverse/ReverseDiff (compiled)/(64, 64, 3, 128) 42100107 ns 50939380 ns 0.83
Conv((3, 3), 3 => 3)/cpu/reverse/Zygote/(64, 64, 3, 128) 78268896 ns 79931782 ns 0.98
Conv((3, 3), 3 => 3)/cpu/reverse/Tracker/(64, 64, 3, 128) 81930428 ns 78661421 ns 1.04
Conv((3, 3), 3 => 3)/cpu/reverse/ReverseDiff/(64, 64, 3, 128) 91319761 ns 91272190.5 ns 1.00
Conv((3, 3), 3 => 3)/cpu/reverse/Flux/(64, 64, 3, 128) 77441785 ns 93377866.5 ns 0.83
Conv((3, 3), 3 => 3)/cpu/reverse/SimpleChains/(64, 64, 3, 128) 11621767 ns 11991869 ns 0.97
Conv((3, 3), 3 => 3)/cpu/forward/NamedTuple/(64, 64, 3, 128) 11984018 ns 18984863.5 ns 0.63
Conv((3, 3), 3 => 3)/cpu/forward/ComponentArray/(64, 64, 3, 128) 12252398 ns 18867999 ns 0.65
Conv((3, 3), 3 => 3)/cpu/forward/Flux/(64, 64, 3, 128) 12110554 ns 18628681 ns 0.65
Conv((3, 3), 3 => 3)/cpu/forward/SimpleChains/(64, 64, 3, 128) 6381710 ns 6427121 ns 0.99
vgg16/cpu/reverse/Zygote/(32, 32, 3, 1) 104703984 ns 109345995 ns 0.96
vgg16/cpu/reverse/Zygote/(32, 32, 3, 16) 847997496 ns 753707936 ns 1.13
vgg16/cpu/reverse/Zygote/(32, 32, 3, 64) 2896732787 ns 2956953751 ns 0.98
vgg16/cpu/reverse/Tracker/(32, 32, 3, 1) 171880817 ns 182122386 ns 0.94
vgg16/cpu/reverse/Tracker/(32, 32, 3, 16) 1123504656 ns 1136980410 ns 0.99
vgg16/cpu/reverse/Tracker/(32, 32, 3, 64) 3884183006 ns 3683425574 ns 1.05
vgg16/cpu/reverse/Flux/(32, 32, 3, 1) 86701609.5 ns 85689271 ns 1.01
vgg16/cpu/reverse/Flux/(32, 32, 3, 16) 764531745 ns 736530234.5 ns 1.04
vgg16/cpu/reverse/Flux/(32, 32, 3, 64) 3044946765 ns 2815110663 ns 1.08
vgg16/cpu/forward/NamedTuple/(32, 32, 3, 1) 25005742 ns 25737587 ns 0.97
vgg16/cpu/forward/NamedTuple/(32, 32, 3, 16) 237344837.5 ns 212298522 ns 1.12
vgg16/cpu/forward/NamedTuple/(32, 32, 3, 64) 890908934 ns 932573050.5 ns 0.96
vgg16/cpu/forward/ComponentArray/(32, 32, 3, 1) 26232019.5 ns 26360056 ns 1.00
vgg16/cpu/forward/ComponentArray/(32, 32, 3, 16) 249546170 ns 212978713 ns 1.17
vgg16/cpu/forward/ComponentArray/(32, 32, 3, 64) 908556049.5 ns 845080145.5 ns 1.08
vgg16/cpu/forward/Flux/(32, 32, 3, 1) 30493357 ns 23696110 ns 1.29
vgg16/cpu/forward/Flux/(32, 32, 3, 16) 188904823 ns 188727204 ns 1.00
vgg16/cpu/forward/Flux/(32, 32, 3, 64) 808155557.5 ns 716121501 ns 1.13
Conv((3, 3), 64 => 64)/cpu/reverse/ReverseDiff (compiled)/(64, 64, 64, 128) 1141332133 ns 1108752997 ns 1.03
Conv((3, 3), 64 => 64)/cpu/reverse/Zygote/(64, 64, 64, 128) 1930549492 ns 1867146644 ns 1.03
Conv((3, 3), 64 => 64)/cpu/reverse/Tracker/(64, 64, 64, 128) 2219418520.5 ns 2187251601.5 ns 1.01
Conv((3, 3), 64 => 64)/cpu/reverse/ReverseDiff/(64, 64, 64, 128) 2280726581.5 ns 2374190547 ns 0.96
Conv((3, 3), 64 => 64)/cpu/reverse/Flux/(64, 64, 64, 128) 1944092891.5 ns 1864310613.5 ns 1.04
Conv((3, 3), 64 => 64)/cpu/forward/NamedTuple/(64, 64, 64, 128) 350031107 ns 362695061 ns 0.97
Conv((3, 3), 64 => 64)/cpu/forward/ComponentArray/(64, 64, 64, 128) 393534877 ns 370586681.5 ns 1.06
Conv((3, 3), 64 => 64)/cpu/forward/Flux/(64, 64, 64, 128) 454637155 ns 371425922.5 ns 1.22
Conv((3, 3), 1 => 1)/cpu/reverse/ReverseDiff (compiled)/(64, 64, 1, 128) 11861198 ns 12052047 ns 0.98
Conv((3, 3), 1 => 1)/cpu/reverse/Zygote/(64, 64, 1, 128) 18013782 ns 18235365.5 ns 0.99
Conv((3, 3), 1 => 1)/cpu/reverse/Tracker/(64, 64, 1, 128) 19265031 ns 19603792 ns 0.98
Conv((3, 3), 1 => 1)/cpu/reverse/ReverseDiff/(64, 64, 1, 128) 23865411 ns 24195903 ns 0.99
Conv((3, 3), 1 => 1)/cpu/reverse/Flux/(64, 64, 1, 128) 17985613 ns 18334453 ns 0.98
Conv((3, 3), 1 => 1)/cpu/reverse/SimpleChains/(64, 64, 1, 128) 1157590 ns 1154292 ns 1.00
Conv((3, 3), 1 => 1)/cpu/forward/NamedTuple/(64, 64, 1, 128) 2082410 ns 2110196 ns 0.99
Conv((3, 3), 1 => 1)/cpu/forward/ComponentArray/(64, 64, 1, 128) 2096276 ns 2170153 ns 0.97
Conv((3, 3), 1 => 1)/cpu/forward/Flux/(64, 64, 1, 128) 2086012 ns 2134836 ns 0.98
Conv((3, 3), 1 => 1)/cpu/forward/SimpleChains/(64, 64, 1, 128) 201080.5 ns 202419 ns 0.99
Dense(200 => 200)/cpu/reverse/ReverseDiff (compiled)/(200, 128) 300131 ns 306714 ns 0.98
Dense(200 => 200)/cpu/reverse/Zygote/(200, 128) 275053 ns 277821 ns 0.99
Dense(200 => 200)/cpu/reverse/Tracker/(200, 128) 365512 ns 372783 ns 0.98
Dense(200 => 200)/cpu/reverse/ReverseDiff/(200, 128) 412680 ns 418944 ns 0.99
Dense(200 => 200)/cpu/reverse/Flux/(200, 128) 275669.5 ns 279253.5 ns 0.99
Dense(200 => 200)/cpu/reverse/SimpleChains/(200, 128) 411067 ns 400691 ns 1.03
Dense(200 => 200)/cpu/forward/NamedTuple/(200, 128) 89361.5 ns 93004 ns 0.96
Dense(200 => 200)/cpu/forward/ComponentArray/(200, 128) 90278.5 ns 96280 ns 0.94
Dense(200 => 200)/cpu/forward/Flux/(200, 128) 86992 ns 89628 ns 0.97
Dense(200 => 200)/cpu/forward/SimpleChains/(200, 128) 104565 ns 105237 ns 0.99
Conv((3, 3), 16 => 16)/cpu/reverse/ReverseDiff (compiled)/(64, 64, 16, 128) 198750894 ns 200438157 ns 0.99
Conv((3, 3), 16 => 16)/cpu/reverse/Zygote/(64, 64, 16, 128) 370021330.5 ns 352793790 ns 1.05
Conv((3, 3), 16 => 16)/cpu/reverse/Tracker/(64, 64, 16, 128) 403815468 ns 408772280 ns 0.99
Conv((3, 3), 16 => 16)/cpu/reverse/ReverseDiff/(64, 64, 16, 128) 457865953 ns 490040365 ns 0.93
Conv((3, 3), 16 => 16)/cpu/reverse/Flux/(64, 64, 16, 128) 351807193 ns 383463253.5 ns 0.92
Conv((3, 3), 16 => 16)/cpu/reverse/SimpleChains/(64, 64, 16, 128) 329612604 ns 368210985 ns 0.90
Conv((3, 3), 16 => 16)/cpu/forward/NamedTuple/(64, 64, 16, 128) 49828050 ns 53892602.5 ns 0.92
Conv((3, 3), 16 => 16)/cpu/forward/ComponentArray/(64, 64, 16, 128) 49597726 ns 53194010 ns 0.93
Conv((3, 3), 16 => 16)/cpu/forward/Flux/(64, 64, 16, 128) 49732016.5 ns 60542610 ns 0.82
Conv((3, 3), 16 => 16)/cpu/forward/SimpleChains/(64, 64, 16, 128) 28110973.5 ns 29155185 ns 0.96
Dense(2000 => 2000)/cpu/reverse/ReverseDiff (compiled)/(2000, 128) 19489304.5 ns 19965939.5 ns 0.98
Dense(2000 => 2000)/cpu/reverse/Zygote/(2000, 128) 19565256 ns 20208135 ns 0.97
Dense(2000 => 2000)/cpu/reverse/Tracker/(2000, 128) 23444841 ns 24305621.5 ns 0.96
Dense(2000 => 2000)/cpu/reverse/ReverseDiff/(2000, 128) 24118525.5 ns 24684238 ns 0.98
Dense(2000 => 2000)/cpu/reverse/Flux/(2000, 128) 19601753 ns 20154517 ns 0.97
Dense(2000 => 2000)/cpu/forward/NamedTuple/(2000, 128) 6594314 ns 6741537.5 ns 0.98
Dense(2000 => 2000)/cpu/forward/ComponentArray/(2000, 128) 6559544 ns 6772766 ns 0.97
Dense(2000 => 2000)/cpu/forward/Flux/(2000, 128) 6488411.5 ns 6680651 ns 0.97

This comment was automatically generated by workflow using github-action-benchmark.

Copy link

codecov bot commented Apr 9, 2024

Codecov Report

Attention: Patch coverage is 92.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 87.51%. Comparing base (2a20c5a) to head (acb3b62).

Files Patch % Lines
ext/LuxTrackerExt.jl 88.88% 1 Missing ⚠️
src/transform/simplechains.jl 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #580      +/-   ##
==========================================
+ Coverage   86.74%   87.51%   +0.77%     
==========================================
  Files          38       37       -1     
  Lines        1962     1971       +9     
==========================================
+ Hits         1702     1725      +23     
+ Misses        260      246      -14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@avik-pal avik-pal merged commit 132b99a into main Apr 9, 2024
22 checks passed
@avik-pal avik-pal deleted the ap/ad_handling branch April 9, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant