-
Notifications
You must be signed in to change notification settings - Fork 116
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
error: Enzyme: No augmented forward pass found for strcpy
#2235
Comments
Enzyme/enzyme/Enzyme/ActivityAnalysis.cpp Line 169 in df197be
You can probably get Enzyme to recognize it as inactive by adding it to one of the lists in this file. (I am not 100% sure which one is the right one) |
Thanks, I'll try that! With the LTO plugin, I get a similar error of the form:
that could point to the same high-level C++ code location... The symbols are differently named though here for the string ops, is there a way to mark those as inactive, too? Full LDD/LTO error.txt |
Yay, adding Now I can continue with the next errors (with the Clang plugin).
What does I can open a separate issue if that would be cleaner. |
I am unable to help with the variant one, as a wild guess I'd say Enzyme should figure that out from TBAA, but I'm not an expert on that. Feel free to make a PR for the strcpy fix, Billy will let you know if it (also) should go into another list. |
Thank you, PR open now in #2236 :) I played a bit more and tried to get rid of the
The issue seems around the usage of this std::variant, which stores all possible element types of our particle accelerator beamline. |
Yes, afaik c++ variants are a more rust like version of the classical c style enums. In Rust we don't add any typetree metadata to enums since Enzyme's parser has no way of reading TypeTrees for them. That occasionally results in iaaues like yours. However, C++ has TBAA so enzyme can figure out how to differentiate classical c style enums quite well. My guess was that c++ probably also has TBAA for variants, and that just Enzyme isn't reading them yet. |
Shall I track this as a separate issue? Sounds like this would be a great addition for C++ codes? 🤩 |
I'll try to build a reproducer for the |
Hi @ludgerpaehler @wsmoses et al.,
I finally have some time to try to autodifferentiate prototypes for our BLAST codes (GB22 code WarpX, sibling particle accelerator code ImpactX). I started a test and demo case here:
ECP-WarpX/impactx#825
I am writing because I am stuck at an error
While the error is sensible, strcpy is not math, I don't get how Enzyme might end up in there. Can you guide me to better ways to debug this or is this an internal bug?
I think this is picked up by a "name" attribute that we carry around with particle accelerator elements, but that attribute does not participate in any math...
The above link has the reproducer using the Clang plugin and a README that contains all instructions. I am attaching the detailed error message here:
error.txt
OS details are Ubuntu 24.02, clang/llvm 16 and the latest
development
branch of Enzyme.(In parallel, I'll try to get the LTO+LLDEnzyme plugin to run because more complex examples will later on often need more than one TU. Will report separately on findings.)
The text was updated successfully, but these errors were encountered: