-
Notifications
You must be signed in to change notification settings - Fork 68
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
Incorrect gradients with BFloat16
#1695
Comments
I am not even sure we fully support |
So most of Enzyme internally is invariant to floating point types. I can see a couple of places where bfloat16 may be missing, but I don't think it's that bad. @avik-pal immediately adding a corresponding conversion of BFloat16 in typetree.jl instead of emitting that error message would at least fix the 0's [since otherwise it is presently detected as inactive and/or internal error] |
Should it be |
I think we would need to add |
I think you would only need to update CApi.cpp for that though and then grep through the Enzyme core source for |
Yeah basically we just need to add something to the capi that shim's bfloat https://github.com/EnzymeAD/Enzyme/blob/9d6a86b46086a2009725f8bfb9af89e7dc7168f6/enzyme/Enzyme/CApi.cpp#L94 and https://github.com/EnzymeAD/Enzyme/blob/9d6a86b46086a2009725f8bfb9af89e7dc7168f6/enzyme/Enzyme/CApi.h#L58 This is only really needed for the c api, as the rest of enzyme's type trees use actual types [i.e. bfloat directly] |
x/ref EnzymeAD/Enzyme#2033 |
hypothetically resolved by #1708 |
I have a feeling it is also crashing my LuxLib tests with an Assertion 😓 but I will try to minimize that later. https://github.com/LuxDL/LuxLib.jl/actions/runs/10210191155/job/28249425224?pr=115#step:6:963
The text was updated successfully, but these errors were encountered: