-
Notifications
You must be signed in to change notification settings - Fork 15
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
mod
is JIT-ed to HLO operator with the semantic of Julia's rem
#755
Comments
I didn't find an HLO function for this operation in https://openxla.org/stablehlo/spec. If we have to roll our own, a possible implementation of # Based on https://github.com/JuliaLang/julia/blob/39255d47db7657950ff1c82137ecec5a70bae622/base/float.jl#L608-L617
function Base.mod(@nospecialize(x::Reactant.TracedRNumber{T}), @nospecialize(y::Reactant.TracedRNumber{T})) where {T}
r = rem(x, y)
return ifelse(r == 0, copysign(r, y), ifelse((r > 0) ⊻ (y > 0), r + y, r))
end but we don't have a method for |
That's not exactly the same thing. |
You can implement |
yep, but stablehlo has a limited amount of ops, and the only op close to it is that one. not even CHLO has one like this https://github.com/openxla/stablehlo/blob/main/stablehlo/dialect/ChloOps.td
remember that this are very high-level ops, so probably XLA can optimize it if we express it well enough. |
That's not true, |
Originally posted by @giordano in #754 (comment)
The text was updated successfully, but these errors were encountered: