-
Notifications
You must be signed in to change notification settings - Fork 69
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
Performance of high order derivatives in Enzyme is slower than finite difference #2252
Comments
You are on an Apple M3/M4? On my system there is a overhead, but it is much smaller.
|
For the fourth derivative I start to see the overhead grow:
|
I am using Apple M3 Pro. I have updated my first post with that information, along with code results for the fourth order derivative. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for adding the capability of computing high order derivatives with Enzyme in #2161!
I benchmarked the performance of Enzyme against finite difference method. For orders greater than 2, I see that finite difference is faster. It is 1.7 times faster for order 3 and 2.4 times faster for order 4. I am sharing my benchmarking code for orders 3 and 4 in case it leads to any ideas for improvement. The mean performance of the third order finite difference method is 8 ns, while that of Enzyme is 14 ns. For the fourth order, finite difference is at 11 ns and Enzyme is at 27 ns.
Benchmarking code for third order
Benchmarking code for fourth order
Benchmarking results for third order
Benchmarking results for fourth order
These results have been generated with Enzyme
v0.13.24
using Apple M3 Pro on Julia 1.11.2.versioninfo()
Here is a gist that checks that the above third and fourth order derivative computations are correct by using a polynomial test case. This gist contains computation and benchmarking of all derivatives up to four.
The text was updated successfully, but these errors were encountered: