Skip to content

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Feb 5, 2025

  • doc a working SW stack of Enzyme
  • doc both work modes (single TU & LLD/LTO)
  • work around variant issue for now
  • disable beam monitor and profiler for now
  • check if it is safe to ignore AMReX globals like ... via -enzyme-globals-default-inactive=1 (see this and docs)
  • not clear if MFIter logic in AMReX can be expressed in a single TU rn with AMReX not supporting unity builds yet... needed? Could mark as __attribute__((enzyme_inactive))?
  • continue more with LLDEnzyme...
  • focus on envelope tracking (and ref particle tracking)

@ax3l ax3l added the component: third party Changes in ImpactX that reflect a change in a third-party library label Feb 5, 2025
@ax3l ax3l force-pushed the topic-enzyme-test branch from 0de939e to 382bfd1 Compare February 5, 2025 05:18
@ax3l ax3l mentioned this pull request Feb 24, 2025
@ax3l ax3l force-pushed the topic-enzyme-test branch from 36693aa to 275f6b1 Compare March 4, 2025 00:07
ax3l added 9 commits June 30, 2025 15:31
Still buggy to get constent LLVM/LLD 16 env path.
Maybe retry with developer docker container.
Enzyme got stuck there first.
Compiles faster to first error.
Have to point `/usr/bin/ld.lld` to LLVM 16 instead of 18 (default)
AMReX globals such as `amrex::ParticleContainerBase::tile_size`:
```
error: Enzyme: cannot compute with global variable that doesn't have marked shadow global
@_ZN5amrex21ParticleContainerBase9tile_sizeE = external local_unnamed_addr global %"class.amrex::IntVectND", align 4
...
```
Compiles & runs in forward and reverse mode.
Forward result is correct, reverse not yet. Likely need to copy
in data (ref, cm, env) instead of the whole `sim` object...?
@ax3l ax3l force-pushed the topic-enzyme-test branch from 79c59f3 to 94c349d Compare August 6, 2025 17:01
Works now in both fw/bw mode.
```
./impactx ../../examples/fodo_space_charge/input_fodo_envelope_sc.in
```
@ax3l ax3l force-pushed the topic-enzyme-test branch 3 times, most recently from 048c178 to 43676ce Compare August 8, 2025 04:42
Full Python bindings and optimizer
@ax3l ax3l force-pushed the topic-enzyme-test branch from 43676ce to 76d3623 Compare August 8, 2025 06:06
Typical gradient tracking issue

verbose = False
# mode = "forward"
mode = "backward"

Check warning

Code scanning / CodeQL

Variable defined multiple times Warning

This assignment to 'mode' is unnecessary as it is
redefined
before this value is used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: third party Changes in ImpactX that reflect a change in a third-party library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant