Repository navigation
Fix wrong results in left_shift/right_shift on overflow - #4694
Conversation
|
@zcbenz Hi, just checking, its fine if you are busy feel free to review when you get the time :) |
|
There are some high priority PRs that are quite hard to review, so this will wait for a while. |
|
I understand, I wanted to ask will it be ok for me to Open more prs? I don't want to overwhelm you with multiple prs if you have limited bandwidth :) |
|
If you have some important fixes then yes, otherwise we would prefer waiting for a while for us to consume the backlog. |
zcbenz
left a comment
There was a problem hiding this comment.
It seems that the mps backend of pytorch has the same bug. I'm good with this change since it is what every other framework does.
I can make an issue and try to make pr to make it consistent, I am not sure how it will work though as Pytorch directly uses mps as backend. |
So currently when the shift is greater than dtype size, for example 32 in case of int 32, the rshift and lshift returns the same value instead of 0 and -1 respectively like how numpy and jax does.
Found in data-apis/array-api-compat#451
I tried to have the upper level fix, but it was not possible so I defaulted to modifying the kernels.
The cpu kernel code was written by AI as I am not that much familiar with cpu simd.
example:
results: