-
Notifications
You must be signed in to change notification settings - Fork 9
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
Can't get Reverse
to work
#151
Comments
This one is a known bug (see But you make a very good point that we shouldn't have it as an example in the book until it is fixed. @ZuseZ4 Do you know how hard this one is to fix? |
Iirc pretty hard and only a very limited benefit. We would literally have to hardcode this case (two f32 getting passed as one f64 or i64, I don't remember which). So any case passing e.g. f32, i32, f32 would still not be handled. |
So just that I understand correctly: This is an issue with a specific combination of inputs due to how |
Is there a calling conv flag inside rust somewhere that can be used to enforce args not getting coalesed? Alternatively you could forcibly pass all args by reference and then shim |
Yep, but it's one of the cases where a hack will take time and has it's own downsides, so I currently still lean towards a more proper fix, where I check on a more granular level what rustc does and only disable those that are too magic for enzyme to reasonably handle. Also I have it as a probably easy onboarding task in mind, where everyone can try to add rust handling for one more special case. Since rustc only has a limited number of these optimizations and doesn't change those much, it wouldn't become a never ending story. |
This example, taken directly from the docs, either always returns 0 for the derivative (
debug
) or does not even compile (release
):Error in debug mode:
Stack trace in release mode:
The text was updated successfully, but these errors were encountered: