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

(WIP) enzyme integration #1125

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open

Conversation

samuelpmishLLNL
Copy link
Contributor

@samuelpmishLLNL samuelpmishLLNL commented May 29, 2024

a preliminary example of integrating enzyme into serac as the primary mechanism of material model differentiation

Some notable benefits of enzyme over serac::dual:

  • excessive use of auto in material models is not required
  • qfunction arguments can also be regular C++ types, rather than auto
  • bodies of qfunctions do not need to use the C++ type system for AD, so some programming constructs (conditionals, operator+=, etc) are much easier to write
  • support for reverse mode differentiation

some notable downsides/changes include:

  • enzyme is relatively new and has some sharp edges (e.g. currently, some qfunctions that use serac::zero are crashing enzyme).
  • requires finite element kernels to be compiled with clang compiler. clang and enzyme do claim to support AMD/NVIDIA GPU backends, but I have not verified that yet.
  • must compile with optimization or enzyme doesn't work (this is fixed if we adopt C++20)

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