-
Notifications
You must be signed in to change notification settings - Fork 5
Enzyme support example #29
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
Conversation
Very cool to see! |
65523d2
to
fd75087
Compare
…ath explicitly set in spack.yaml.
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.
Compiled and ran with LLVM v18.1.8 and Enzyme v0.0.172 on Ubuntu 20.04.6 LTS (WSL). All test passed locally.
Besides the ninja
issue, everything looks good to me.
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.
Looks good! Let me know if you run into issues with clang/phase ordering/etc. Good luck!
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.
I suggest we merge this as it has basic infrastructure and tests for Enzyme support. We can expand testing and documentation through subsequent PRs.
I left a couple of nitpicking comments.
#install(TARGETS ${CMAKE_CURRENT_BINARY_DIR}/EnzymeLibCheck DESTINATION bin) | ||
|
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.
Do we want to install Enzyme targets or this is out of scope for this PR?
double square(double x) { | ||
return x * x; | ||
} | ||
|
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.
Should this be hard-wired double
or configurable real_type
?
* Preliminary support for automatic differentiation using Enzyme * Build GridKit with Enzyme as dependency * Add simple Enzyme tests * Add Spack package for GridKit. * gridkit +enzyme in CI. * Update README with Enzyme dependency. * Changed Enzyme add_custom_target name to fix build issues with Ninja. --------- Co-authored-by: Asher Mancinelli <ashermancinelli@gmail.com> Co-authored-by: Slaven Peles <peless@ornl.gov>
This builds on earlier work from Asher and Slaven to add examples using the Enzyme automatic differentiation library.
There are two new tests compared to
develop
that should pass.Building Enzyme from source is discussed in #23. I tested that approach as well as building LLVM and Enzyme through Spack, and both approaches work for this use-case.