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

feat: allow multiple @return #760

Merged
merged 4 commits into from
Jul 12, 2024
Merged

feat: allow multiple @return #760

merged 4 commits into from
Jul 12, 2024

Conversation

avik-pal
Copy link
Member

Needs tests

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: 123dc21 Previous: c0f03a0 Ratio
Dense(2 => 2)/cpu/reverse/ReverseDiff (compiled)/(2, 128) 3639.25 ns 3604.25 ns 1.01
Dense(2 => 2)/cpu/reverse/Zygote/(2, 128) 7116 ns 7170 ns 0.99
Dense(2 => 2)/cpu/reverse/Tracker/(2, 128) 20930 ns 20669 ns 1.01
Dense(2 => 2)/cpu/reverse/ReverseDiff/(2, 128) 9964.6 ns 9613.8 ns 1.04
Dense(2 => 2)/cpu/reverse/Flux/(2, 128) 8984.8 ns 9197 ns 0.98
Dense(2 => 2)/cpu/reverse/SimpleChains/(2, 128) 4492.25 ns 4430.75 ns 1.01
Dense(2 => 2)/cpu/reverse/Enzyme/(2, 128) 1155.3785714285714 ns 1151.2978723404256 ns 1.00
Dense(2 => 2)/cpu/forward/NamedTuple/(2, 128) 1107.9607843137255 ns 1166.2941176470588 ns 0.95
Dense(2 => 2)/cpu/forward/ComponentArray/(2, 128) 1162.6737588652481 ns 1166.7202797202797 ns 1.00
Dense(2 => 2)/cpu/forward/Flux/(2, 128) 1778.095238095238 ns 1769.4193548387098 ns 1.00
Dense(2 => 2)/cpu/forward/SimpleChains/(2, 128) 179.76190476190476 ns 179.31849791376914 ns 1.00
Dense(20 => 20)/cpu/reverse/ReverseDiff (compiled)/(20, 128) 17262 ns 17353 ns 0.99
Dense(20 => 20)/cpu/reverse/Zygote/(20, 128) 16792 ns 16601 ns 1.01
Dense(20 => 20)/cpu/reverse/Tracker/(20, 128) 39094 ns 36883.5 ns 1.06
Dense(20 => 20)/cpu/reverse/ReverseDiff/(20, 128) 29225 ns 27962 ns 1.05
Dense(20 => 20)/cpu/reverse/Flux/(20, 128) 19937 ns 20127 ns 0.99
Dense(20 => 20)/cpu/reverse/SimpleChains/(20, 128) 17142 ns 17012 ns 1.01
Dense(20 => 20)/cpu/reverse/Enzyme/(20, 128) 4325.142857142857 ns 4306.571428571428 ns 1.00
Dense(20 => 20)/cpu/forward/NamedTuple/(20, 128) 3863.5 ns 3825.875 ns 1.01
Dense(20 => 20)/cpu/forward/ComponentArray/(20, 128) 3939.875 ns 3911 ns 1.01
Dense(20 => 20)/cpu/forward/Flux/(20, 128) 5010.857142857143 ns 4856.285714285715 ns 1.03
Dense(20 => 20)/cpu/forward/SimpleChains/(20, 128) 1653.1 ns 1653.1 ns 1
Conv((3, 3), 3 => 3)/cpu/reverse/ReverseDiff (compiled)/(64, 64, 3, 128) 46826301 ns 49241683 ns 0.95
Conv((3, 3), 3 => 3)/cpu/reverse/Zygote/(64, 64, 3, 128) 58004661 ns 57960280 ns 1.00
Conv((3, 3), 3 => 3)/cpu/reverse/Tracker/(64, 64, 3, 128) 108981401 ns 110687528 ns 0.98
Conv((3, 3), 3 => 3)/cpu/reverse/ReverseDiff/(64, 64, 3, 128) 95979593 ns 107034221 ns 0.90
Conv((3, 3), 3 => 3)/cpu/reverse/Flux/(64, 64, 3, 128) 106694644.5 ns 107263120.5 ns 0.99
Conv((3, 3), 3 => 3)/cpu/reverse/SimpleChains/(64, 64, 3, 128) 11568534.5 ns 11972413 ns 0.97
Conv((3, 3), 3 => 3)/cpu/reverse/Enzyme/(64, 64, 3, 128) 6947419 ns 6920385 ns 1.00
Conv((3, 3), 3 => 3)/cpu/forward/NamedTuple/(64, 64, 3, 128) 7125473 ns 7063697 ns 1.01
Conv((3, 3), 3 => 3)/cpu/forward/ComponentArray/(64, 64, 3, 128) 7042538 ns 7116659 ns 0.99
Conv((3, 3), 3 => 3)/cpu/forward/Flux/(64, 64, 3, 128) 12566820 ns 19130332 ns 0.66
Conv((3, 3), 3 => 3)/cpu/forward/SimpleChains/(64, 64, 3, 128) 6383242 ns 6378626.5 ns 1.00
vgg16/cpu/reverse/Zygote/(32, 32, 3, 16) 696826731 ns 676277931 ns 1.03
vgg16/cpu/reverse/Zygote/(32, 32, 3, 64) 2576638468 ns 2529085990 ns 1.02
vgg16/cpu/reverse/Zygote/(32, 32, 3, 2) 144290971.5 ns 133234444 ns 1.08
vgg16/cpu/reverse/Tracker/(32, 32, 3, 16) 877306585 ns 944154886 ns 0.93
vgg16/cpu/reverse/Tracker/(32, 32, 3, 64) 3300818087 ns 3667947313 ns 0.90
vgg16/cpu/reverse/Tracker/(32, 32, 3, 2) 217829487 ns 228784367 ns 0.95
vgg16/cpu/reverse/Flux/(32, 32, 3, 16) 753687000.5 ns 999814712.5 ns 0.75
vgg16/cpu/reverse/Flux/(32, 32, 3, 64) 2990712213 ns 3305914576 ns 0.90
vgg16/cpu/reverse/Flux/(32, 32, 3, 2) 149407359 ns 151210631.5 ns 0.99
vgg16/cpu/forward/NamedTuple/(32, 32, 3, 16) 174877969 ns 171977811.5 ns 1.02
vgg16/cpu/forward/NamedTuple/(32, 32, 3, 64) 656291037.5 ns 648927758 ns 1.01
vgg16/cpu/forward/NamedTuple/(32, 32, 3, 2) 34522705 ns 34417243 ns 1.00
vgg16/cpu/forward/ComponentArray/(32, 32, 3, 16) 165295982 ns 168092289 ns 0.98
vgg16/cpu/forward/ComponentArray/(32, 32, 3, 64) 639597680.5 ns 640573982 ns 1.00
vgg16/cpu/forward/ComponentArray/(32, 32, 3, 2) 30095359 ns 29659101 ns 1.01
vgg16/cpu/forward/Flux/(32, 32, 3, 16) 213459097.5 ns 200849870 ns 1.06
vgg16/cpu/forward/Flux/(32, 32, 3, 64) 860272137 ns 833750681 ns 1.03
vgg16/cpu/forward/Flux/(32, 32, 3, 2) 37967772 ns 37541910 ns 1.01
Conv((3, 3), 64 => 64)/cpu/reverse/ReverseDiff (compiled)/(64, 64, 64, 128) 1217801158.5 ns 1179860972 ns 1.03
Conv((3, 3), 64 => 64)/cpu/reverse/Zygote/(64, 64, 64, 128) 1866856158 ns 1861619729 ns 1.00
Conv((3, 3), 64 => 64)/cpu/reverse/Tracker/(64, 64, 64, 128) 2489202792 ns 2504278030 ns 0.99
Conv((3, 3), 64 => 64)/cpu/reverse/ReverseDiff/(64, 64, 64, 128) 2489836744 ns 2474701932 ns 1.01
Conv((3, 3), 64 => 64)/cpu/reverse/Flux/(64, 64, 64, 128) 1964209829.5 ns 1999749817.5 ns 0.98
Conv((3, 3), 64 => 64)/cpu/reverse/Enzyme/(64, 64, 64, 128) 322775412.5 ns 318275806.5 ns 1.01
Conv((3, 3), 64 => 64)/cpu/forward/NamedTuple/(64, 64, 64, 128) 321456115 ns 317826145 ns 1.01
Conv((3, 3), 64 => 64)/cpu/forward/ComponentArray/(64, 64, 64, 128) 321225736 ns 316745015 ns 1.01
Conv((3, 3), 64 => 64)/cpu/forward/Flux/(64, 64, 64, 128) 473226447 ns 429906704 ns 1.10
Conv((3, 3), 1 => 1)/cpu/reverse/ReverseDiff (compiled)/(64, 64, 1, 128) 13350318.5 ns 11667810 ns 1.14
Conv((3, 3), 1 => 1)/cpu/reverse/Zygote/(64, 64, 1, 128) 18116394 ns 17908951 ns 1.01
Conv((3, 3), 1 => 1)/cpu/reverse/Tracker/(64, 64, 1, 128) 19270773 ns 19106808 ns 1.01
Conv((3, 3), 1 => 1)/cpu/reverse/ReverseDiff/(64, 64, 1, 128) 23965361 ns 23766079 ns 1.01
Conv((3, 3), 1 => 1)/cpu/reverse/Flux/(64, 64, 1, 128) 18057127.5 ns 17918013 ns 1.01
Conv((3, 3), 1 => 1)/cpu/reverse/SimpleChains/(64, 64, 1, 128) 1161582 ns 1158548 ns 1.00
Conv((3, 3), 1 => 1)/cpu/reverse/Enzyme/(64, 64, 1, 128) 2114693 ns 2057538.5 ns 1.03
Conv((3, 3), 1 => 1)/cpu/forward/NamedTuple/(64, 64, 1, 128) 2135121 ns 2073008.5 ns 1.03
Conv((3, 3), 1 => 1)/cpu/forward/ComponentArray/(64, 64, 1, 128) 2080730 ns 2075418 ns 1.00
Conv((3, 3), 1 => 1)/cpu/forward/Flux/(64, 64, 1, 128) 2078105 ns 2076144 ns 1.00
Conv((3, 3), 1 => 1)/cpu/forward/SimpleChains/(64, 64, 1, 128) 198061 ns 199922.5 ns 0.99
Dense(200 => 200)/cpu/reverse/ReverseDiff (compiled)/(200, 128) 290124 ns 290632 ns 1.00
Dense(200 => 200)/cpu/reverse/Zygote/(200, 128) 263464 ns 263000 ns 1.00
Dense(200 => 200)/cpu/reverse/Tracker/(200, 128) 361963 ns 362270 ns 1.00
Dense(200 => 200)/cpu/reverse/ReverseDiff/(200, 128) 404729 ns 404589.5 ns 1.00
Dense(200 => 200)/cpu/reverse/Flux/(200, 128) 272371 ns 272262.5 ns 1.00
Dense(200 => 200)/cpu/reverse/SimpleChains/(200, 128) 406202 ns 407625 ns 1.00
Dense(200 => 200)/cpu/reverse/Enzyme/(200, 128) 83346 ns 83105 ns 1.00
Dense(200 => 200)/cpu/forward/NamedTuple/(200, 128) 80861 ns 80730 ns 1.00
Dense(200 => 200)/cpu/forward/ComponentArray/(200, 128) 81132 ns 81021 ns 1.00
Dense(200 => 200)/cpu/forward/Flux/(200, 128) 85881 ns 86121 ns 1.00
Dense(200 => 200)/cpu/forward/SimpleChains/(200, 128) 104366 ns 104365 ns 1.00
Conv((3, 3), 16 => 16)/cpu/reverse/ReverseDiff (compiled)/(64, 64, 16, 128) 209785764.5 ns 212248406.5 ns 0.99
Conv((3, 3), 16 => 16)/cpu/reverse/Zygote/(64, 64, 16, 128) 327745365.5 ns 327280336.5 ns 1.00
Conv((3, 3), 16 => 16)/cpu/reverse/Tracker/(64, 64, 16, 128) 442957319 ns 450238435.5 ns 0.98
Conv((3, 3), 16 => 16)/cpu/reverse/ReverseDiff/(64, 64, 16, 128) 474194883.5 ns 508490953 ns 0.93
Conv((3, 3), 16 => 16)/cpu/reverse/Flux/(64, 64, 16, 128) 405794909.5 ns 419359652 ns 0.97
Conv((3, 3), 16 => 16)/cpu/reverse/SimpleChains/(64, 64, 16, 128) 346616542 ns 317806942.5 ns 1.09
Conv((3, 3), 16 => 16)/cpu/reverse/Enzyme/(64, 64, 16, 128) 44629597 ns 44054551 ns 1.01
Conv((3, 3), 16 => 16)/cpu/forward/NamedTuple/(64, 64, 16, 128) 44188929 ns 44114540.5 ns 1.00
Conv((3, 3), 16 => 16)/cpu/forward/ComponentArray/(64, 64, 16, 128) 43885853 ns 43922579 ns 1.00
Conv((3, 3), 16 => 16)/cpu/forward/Flux/(64, 64, 16, 128) 57314056 ns 57543157 ns 1.00
Conv((3, 3), 16 => 16)/cpu/forward/SimpleChains/(64, 64, 16, 128) 27744222 ns 28648610 ns 0.97
Dense(2000 => 2000)/cpu/reverse/ReverseDiff (compiled)/(2000, 128) 18888766 ns 18727776 ns 1.01
Dense(2000 => 2000)/cpu/reverse/Zygote/(2000, 128) 19639467.5 ns 19448960.5 ns 1.01
Dense(2000 => 2000)/cpu/reverse/Tracker/(2000, 128) 23607560 ns 23160761 ns 1.02
Dense(2000 => 2000)/cpu/reverse/ReverseDiff/(2000, 128) 24165357 ns 24009458 ns 1.01
Dense(2000 => 2000)/cpu/reverse/Flux/(2000, 128) 19644845 ns 19509547 ns 1.01
Dense(2000 => 2000)/cpu/reverse/Enzyme/(2000, 128) 6521225.5 ns 6512284.5 ns 1.00
Dense(2000 => 2000)/cpu/forward/NamedTuple/(2000, 128) 6551046.5 ns 6510712 ns 1.01
Dense(2000 => 2000)/cpu/forward/ComponentArray/(2000, 128) 6514067 ns 6463513.5 ns 1.01
Dense(2000 => 2000)/cpu/forward/Flux/(2000, 128) 6607597.5 ns 6488277.5 ns 1.02

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

Copy link

codecov bot commented Jul 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.98%. Comparing base (af196ba) to head (123dc21).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #760      +/-   ##
==========================================
+ Coverage   95.87%   95.98%   +0.10%     
==========================================
  Files          58       58              
  Lines        2813     2814       +1     
==========================================
+ Hits         2697     2701       +4     
+ Misses        116      113       -3     

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

@avik-pal avik-pal merged commit 6a9ef65 into main Jul 12, 2024
63 of 66 checks passed
@avik-pal avik-pal deleted the ap/multi_return branch July 12, 2024 17:18
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