Skip to content

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants