cupy.min returns a wrong value when CUB is enabled for float16 inputs.
Reproducer:
import cupy
print(cupy.array([1, 2, 3], dtype='e').min())
print(cupy.array([1, 2, 3], dtype='e').max())
print(cupy.array([1, 2, 3], dtype='f').min())
print(cupy.array([1, 2, 3], dtype='f').max())
Result:
65500.0
3.0
1.0
3.0
I think this line should return b instead?
https://github.com/cupy/cupy/blob/25b68333154c5aa59750fb6a83ef12f7dc0552f7/cupy/cuda/cupy_cub.cu#L204
@leofang I made a fix. Thanks for your help!
Thanks, @asi1024 馃檪
Most helpful comment
I think this line should return
binstead?https://github.com/cupy/cupy/blob/25b68333154c5aa59750fb6a83ef12f7dc0552f7/cupy/cuda/cupy_cub.cu#L204