awkward icon indicating copy to clipboard operation
awkward copied to clipboard

CUDA `ak.max` result on `cuda` backend doesn't agree with baseline `cpu`

Open ianna opened this issue 1 year ago • 0 comments

Version of Awkward Array

master branch (2.6.7)

Description and code to reproduce

It seems like switching to a recommended random generator revealed a bug. To reproduce:

import numpy as np
import cupy as cp
import awkward as ak
rng = np.random.default_rng(seed=42)
array = rng.integers(3000, size=3000)
content = ak.contents.NumpyArray(array)
cuda_content = ak.to_backend(content, "cuda", highlevel=False)

one can check that:

>>> np.max(array)
2998
>>> ak.max(content)
2998
>>> ak.max(cuda_content)
array(2997)
>>> len(cuda_content)
3000
>>> len(content)
3000
>>> ak.argmax(content)
2261
>>> cuda_content[2261]
array(2998)

ianna avatar Aug 16 '24 15:08 ianna