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

Restore the rrule for merge #659

Merged
merged 1 commit into from
May 19, 2024
Merged

Restore the rrule for merge #659

merged 1 commit into from
May 19, 2024

Conversation

avik-pal
Copy link
Member

@ChrisRackauckas this will fix the SciMLSensitivity error. Not sure what is the underlying issue though, this is clearly a type piracy which shouldn't be needed.

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: 3d1e0c6 Previous: 2a866be Ratio
Dense(2 => 2)/cpu/reverse/ReverseDiff (compiled)/(2, 128) 3862.125 ns 3669.375 ns 1.05
Dense(2 => 2)/cpu/reverse/Zygote/(2, 128) 7173.2 ns 7280.333333333333 ns 0.99
Dense(2 => 2)/cpu/reverse/Tracker/(2, 128) 19907 ns 20599 ns 0.97
Dense(2 => 2)/cpu/reverse/ReverseDiff/(2, 128) 9437.6 ns 9582 ns 0.98
Dense(2 => 2)/cpu/reverse/Flux/(2, 128) 8983.7 ns 8914.6 ns 1.01
Dense(2 => 2)/cpu/reverse/SimpleChains/(2, 128) 4430.75 ns 4422 ns 1.00
Dense(2 => 2)/cpu/reverse/Enzyme/(2, 128) 1198.6120689655172 ns 1198.9590163934427 ns 1.00
Dense(2 => 2)/cpu/forward/NamedTuple/(2, 128) 1165.5757575757575 ns 1112.5786163522012 ns 1.05
Dense(2 => 2)/cpu/forward/ComponentArray/(2, 128) 1178.9624060150377 ns 1180.9856115107914 ns 1.00
Dense(2 => 2)/cpu/forward/Flux/(2, 128) 1774.622641509434 ns 1794.1864406779662 ns 0.99
Dense(2 => 2)/cpu/forward/SimpleChains/(2, 128) 179.75599435825106 ns 179.262341325811 ns 1.00
Dense(20 => 20)/cpu/reverse/ReverseDiff (compiled)/(20, 128) 17282 ns 17322 ns 1.00
Dense(20 => 20)/cpu/reverse/Zygote/(20, 128) 17513 ns 17532 ns 1.00
Dense(20 => 20)/cpu/reverse/Tracker/(20, 128) 36458 ns 36779 ns 0.99
Dense(20 => 20)/cpu/reverse/ReverseDiff/(20, 128) 27932 ns 28073 ns 0.99
Dense(20 => 20)/cpu/reverse/Flux/(20, 128) 19837 ns 19877 ns 1.00
Dense(20 => 20)/cpu/reverse/SimpleChains/(20, 128) 16881 ns 16801 ns 1.00
Dense(20 => 20)/cpu/reverse/Enzyme/(20, 128) 4381 ns 4333.857142857143 ns 1.01
Dense(20 => 20)/cpu/forward/NamedTuple/(20, 128) 3896 ns 3888.625 ns 1.00
Dense(20 => 20)/cpu/forward/ComponentArray/(20, 128) 3974.875 ns 3981.25 ns 1.00
Dense(20 => 20)/cpu/forward/Flux/(20, 128) 4874.714285714285 ns 4990.714285714285 ns 0.98
Dense(20 => 20)/cpu/forward/SimpleChains/(20, 128) 1670.1 ns 1662.1 ns 1.00
Conv((3, 3), 3 => 3)/cpu/reverse/ReverseDiff (compiled)/(64, 64, 3, 128) 42300959 ns 38952154 ns 1.09
Conv((3, 3), 3 => 3)/cpu/reverse/Zygote/(64, 64, 3, 128) 58247127 ns 57640902 ns 1.01
Conv((3, 3), 3 => 3)/cpu/reverse/Tracker/(64, 64, 3, 128) 109635878.5 ns 71710714.5 ns 1.53
Conv((3, 3), 3 => 3)/cpu/reverse/ReverseDiff/(64, 64, 3, 128) 107106913 ns 88813041.5 ns 1.21
Conv((3, 3), 3 => 3)/cpu/reverse/Flux/(64, 64, 3, 128) 105571713.5 ns 72723443 ns 1.45
Conv((3, 3), 3 => 3)/cpu/reverse/SimpleChains/(64, 64, 3, 128) 11685562 ns 11766883 ns 0.99
Conv((3, 3), 3 => 3)/cpu/reverse/Enzyme/(64, 64, 3, 128) 17785802 ns 8476633 ns 2.10
Conv((3, 3), 3 => 3)/cpu/forward/NamedTuple/(64, 64, 3, 128) 7025384 ns 7046540 ns 1.00
Conv((3, 3), 3 => 3)/cpu/forward/ComponentArray/(64, 64, 3, 128) 6997031 ns 7005955 ns 1.00
Conv((3, 3), 3 => 3)/cpu/forward/Flux/(64, 64, 3, 128) 18039925.5 ns 10530991 ns 1.71
Conv((3, 3), 3 => 3)/cpu/forward/SimpleChains/(64, 64, 3, 128) 6401821 ns 6400580 ns 1.00
vgg16/cpu/reverse/Zygote/(32, 32, 3, 16) 719877640.5 ns 709679665 ns 1.01
vgg16/cpu/reverse/Zygote/(32, 32, 3, 64) 2870027193 ns 2835972125 ns 1.01
vgg16/cpu/reverse/Zygote/(32, 32, 3, 2) 146074987 ns 160659965 ns 0.91
vgg16/cpu/reverse/Tracker/(32, 32, 3, 16) 894751814 ns 752407029 ns 1.19
vgg16/cpu/reverse/Tracker/(32, 32, 3, 64) 3073723221 ns 2546120620 ns 1.21
vgg16/cpu/reverse/Tracker/(32, 32, 3, 2) 187942622 ns 196895225 ns 0.95
vgg16/cpu/reverse/Flux/(32, 32, 3, 16) 872936156 ns 720159708 ns 1.21
vgg16/cpu/reverse/Flux/(32, 32, 3, 64) 3244770345 ns 2731538703 ns 1.19
vgg16/cpu/reverse/Flux/(32, 32, 3, 2) 149084725.5 ns 124336484 ns 1.20
vgg16/cpu/forward/NamedTuple/(32, 32, 3, 16) 175724085 ns 172239449 ns 1.02
vgg16/cpu/forward/NamedTuple/(32, 32, 3, 64) 652399979 ns 642436307.5 ns 1.02
vgg16/cpu/forward/NamedTuple/(32, 32, 3, 2) 34502427 ns 45370320 ns 0.76
vgg16/cpu/forward/ComponentArray/(32, 32, 3, 16) 164930214.5 ns 164713553.5 ns 1.00
vgg16/cpu/forward/ComponentArray/(32, 32, 3, 64) 633516721 ns 639941245 ns 0.99
vgg16/cpu/forward/ComponentArray/(32, 32, 3, 2) 30172346.5 ns 30400796 ns 0.99
vgg16/cpu/forward/Flux/(32, 32, 3, 16) 191225171.5 ns 185024422.5 ns 1.03
vgg16/cpu/forward/Flux/(32, 32, 3, 64) 884755738 ns 742411361 ns 1.19
vgg16/cpu/forward/Flux/(32, 32, 3, 2) 37927046.5 ns 35336203 ns 1.07
Conv((3, 3), 64 => 64)/cpu/reverse/ReverseDiff (compiled)/(64, 64, 64, 128) 1267044354.5 ns 1221666322.5 ns 1.04
Conv((3, 3), 64 => 64)/cpu/reverse/Zygote/(64, 64, 64, 128) 1868903526 ns 1870625278 ns 1.00
Conv((3, 3), 64 => 64)/cpu/reverse/Tracker/(64, 64, 64, 128) 2026143340 ns 2167914981.5 ns 0.93
Conv((3, 3), 64 => 64)/cpu/reverse/ReverseDiff/(64, 64, 64, 128) 2351804237.5 ns 2317427712.5 ns 1.01
Conv((3, 3), 64 => 64)/cpu/reverse/Flux/(64, 64, 64, 128) 1902516075 ns 1790838711.5 ns 1.06
Conv((3, 3), 64 => 64)/cpu/reverse/Enzyme/(64, 64, 64, 128) 546705962 ns 350970706 ns 1.56
Conv((3, 3), 64 => 64)/cpu/forward/NamedTuple/(64, 64, 64, 128) 319547425.5 ns 320997548.5 ns 1.00
Conv((3, 3), 64 => 64)/cpu/forward/ComponentArray/(64, 64, 64, 128) 320870810 ns 321496032.5 ns 1.00
Conv((3, 3), 64 => 64)/cpu/forward/Flux/(64, 64, 64, 128) 411587819 ns 355099855 ns 1.16
Conv((3, 3), 1 => 1)/cpu/reverse/ReverseDiff (compiled)/(64, 64, 1, 128) 11849117 ns 11838794 ns 1.00
Conv((3, 3), 1 => 1)/cpu/reverse/Zygote/(64, 64, 1, 128) 17962572 ns 17898707 ns 1.00
Conv((3, 3), 1 => 1)/cpu/reverse/Tracker/(64, 64, 1, 128) 19191693 ns 19130086 ns 1.00
Conv((3, 3), 1 => 1)/cpu/reverse/ReverseDiff/(64, 64, 1, 128) 23783552 ns 23811780.5 ns 1.00
Conv((3, 3), 1 => 1)/cpu/reverse/Flux/(64, 64, 1, 128) 18001820 ns 17973841 ns 1.00
Conv((3, 3), 1 => 1)/cpu/reverse/SimpleChains/(64, 64, 1, 128) 1149002 ns 1169676 ns 0.98
Conv((3, 3), 1 => 1)/cpu/reverse/Enzyme/(64, 64, 1, 128) 5784257 ns 2526472.5 ns 2.29
Conv((3, 3), 1 => 1)/cpu/forward/NamedTuple/(64, 64, 1, 128) 2047872 ns 2058818.5 ns 0.99
Conv((3, 3), 1 => 1)/cpu/forward/ComponentArray/(64, 64, 1, 128) 2026472.5 ns 2040219 ns 0.99
Conv((3, 3), 1 => 1)/cpu/forward/Flux/(64, 64, 1, 128) 2066382 ns 2075980 ns 1.00
Conv((3, 3), 1 => 1)/cpu/forward/SimpleChains/(64, 64, 1, 128) 197879 ns 204222 ns 0.97
Dense(200 => 200)/cpu/reverse/ReverseDiff (compiled)/(200, 128) 293306 ns 291976 ns 1.00
Dense(200 => 200)/cpu/reverse/Zygote/(200, 128) 264683 ns 266062.5 ns 0.99
Dense(200 => 200)/cpu/reverse/Tracker/(200, 128) 362951.5 ns 366104 ns 0.99
Dense(200 => 200)/cpu/reverse/ReverseDiff/(200, 128) 406818 ns 409981 ns 0.99
Dense(200 => 200)/cpu/reverse/Flux/(200, 128) 274045.5 ns 276541.5 ns 0.99
Dense(200 => 200)/cpu/reverse/SimpleChains/(200, 128) 406387 ns 408022 ns 1.00
Dense(200 => 200)/cpu/reverse/Enzyme/(200, 128) 83736 ns 83165 ns 1.01
Dense(200 => 200)/cpu/forward/NamedTuple/(200, 128) 82163 ns 81222 ns 1.01
Dense(200 => 200)/cpu/forward/ComponentArray/(200, 128) 81933 ns 81722 ns 1.00
Dense(200 => 200)/cpu/forward/Flux/(200, 128) 86901.5 ns 87032 ns 1.00
Dense(200 => 200)/cpu/forward/SimpleChains/(200, 128) 104585 ns 104516 ns 1.00
Conv((3, 3), 16 => 16)/cpu/reverse/ReverseDiff (compiled)/(64, 64, 16, 128) 199474078 ns 188927480 ns 1.06
Conv((3, 3), 16 => 16)/cpu/reverse/Zygote/(64, 64, 16, 128) 323873576.5 ns 324906661 ns 1.00
Conv((3, 3), 16 => 16)/cpu/reverse/Tracker/(64, 64, 16, 128) 440375976.5 ns 394040123 ns 1.12
Conv((3, 3), 16 => 16)/cpu/reverse/ReverseDiff/(64, 64, 16, 128) 474003840.5 ns 479556483 ns 0.99
Conv((3, 3), 16 => 16)/cpu/reverse/Flux/(64, 64, 16, 128) 407188878 ns 372077273 ns 1.09
Conv((3, 3), 16 => 16)/cpu/reverse/SimpleChains/(64, 64, 16, 128) 328226389 ns 328660700.5 ns 1.00
Conv((3, 3), 16 => 16)/cpu/reverse/Enzyme/(64, 64, 16, 128) 100726691.5 ns 51470201 ns 1.96
Conv((3, 3), 16 => 16)/cpu/forward/NamedTuple/(64, 64, 16, 128) 43846527 ns 43859960 ns 1.00
Conv((3, 3), 16 => 16)/cpu/forward/ComponentArray/(64, 64, 16, 128) 43573107 ns 43858980 ns 0.99
Conv((3, 3), 16 => 16)/cpu/forward/Flux/(64, 64, 16, 128) 70114900 ns 59466808 ns 1.18
Conv((3, 3), 16 => 16)/cpu/forward/SimpleChains/(64, 64, 16, 128) 27992634 ns 28625276 ns 0.98
Dense(2000 => 2000)/cpu/reverse/ReverseDiff (compiled)/(2000, 128) 18824440 ns 19049587 ns 0.99
Dense(2000 => 2000)/cpu/reverse/Zygote/(2000, 128) 19470505 ns 19503862 ns 1.00
Dense(2000 => 2000)/cpu/reverse/Tracker/(2000, 128) 23241153 ns 23216947 ns 1.00
Dense(2000 => 2000)/cpu/reverse/ReverseDiff/(2000, 128) 24109131 ns 24035928 ns 1.00
Dense(2000 => 2000)/cpu/reverse/Flux/(2000, 128) 19598801 ns 19591788 ns 1.00
Dense(2000 => 2000)/cpu/reverse/Enzyme/(2000, 128) 6512469.5 ns 6531167 ns 1.00
Dense(2000 => 2000)/cpu/forward/NamedTuple/(2000, 128) 6512980 ns 6514635 ns 1.00
Dense(2000 => 2000)/cpu/forward/ComponentArray/(2000, 128) 6490743.5 ns 6490360 ns 1.00
Dense(2000 => 2000)/cpu/forward/Flux/(2000, 128) 6525844 ns 6506068.5 ns 1.00

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

Copy link

codecov bot commented May 19, 2024

Codecov Report

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

Project coverage is 86.87%. Comparing base (2a866be) to head (3d1e0c6).

Files Patch % Lines
src/chainrules.jl 87.50% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #659   +/-   ##
=======================================
  Coverage   86.87%   86.87%           
=======================================
  Files          50       50           
  Lines        2483     2491    +8     
=======================================
+ Hits         2157     2164    +7     
- Misses        326      327    +1     

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

@avik-pal avik-pal merged commit 50a7d90 into main May 19, 2024
72 of 73 checks passed
@avik-pal avik-pal deleted the ap/restore_merge branch May 19, 2024 23:15
@ChrisRackauckas
Copy link
Contributor

@oxinabox can we upstream this then?

@oxinabox
Copy link
Contributor

Yes we can. I will move it, and add tests.

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.

3 participants