-
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
Wrong stablehlo.add
semantics for booleans in docs
#2630
Comments
stablehlo.add
semantics in docsstablehlo.add
semantics for booleans in docs
CC @wsmoses |
Hi @mofeing, the spec is reflective of the behavior that XLA follows. I'm not familiar with Reactant -- is it using StableHLO apis that incorrectly results in the XOR behavior? |
Sample file:
Using StableHLO reference interpreter:
Using HLO Runner:
Indeed looks like the XLA behavior is XOR, perhaps a bug in the spec. Numpy behavior for completeness, follows StableHLO spec, XLA is different:
|
i see, so anyway, yes, there seems to be a mismatch between XLA and StableHLO spec for this op. should I move the issue to XLA then? |
My guess is we'll fix the StableHLO spec. We intended the spec to capture XLA behavior and divergences were a bug. It seems like XLA behavior has always been truncation. It may be that the fix here lives in the JAX layer in how it lowers boolean addition, to match numpy semantics |
What happened?
StableHLO spec says that
stablehlo.add
op on booleans should behave as "logical OR".but that's not the logical behavior nor the implementation (which is "logical XOR").
Steps to reproduce your issue
Using Reactant (which is a Julia frontend to Enzyme + XLA), we can see that it behaves as a logical XOR:
Version information
No response
The text was updated successfully, but these errors were encountered: