Open ericspod opened 1 week ago
The current temporary fix is to disable Numpy 2.0 in requirements.txt and then we'll work on compatibility fixes. There are other issues beyond the raised here in terms of deterministic behaviour and accuracy and seen in tests when run with Numpy 2.0 and some fixes I tried.
Describe the bug Numpy 2.0 was just released with some behavioural changes which are showing up as bugs. One that is seen in this trace:
The underlying issue is that the
MAX_SEED
value is 2**32 which is an overflow value for uint32. It is stored as a Pythonint
but when used as the right hand side of modulus in this expression where_seed
is a uint32 of any value, the exception shown above is raised. In Numpy before 2.0, the expression would silently produce a int64 result.To Reproduce Steps to reproduce the behavior:
np.uint32(1)%(np.iinfo(np.uint32).max+1)
Expected behavior No exception should be raise for this operations if the MAX_SEED value is set correctly. The result from the expression should be a uint32.
Environment
Ensuring you use the relevant python executable, please paste the output of:
Additional context This was encountered when doing a PR on the
gen-ai-dev
branch. @virginiafdez