Skip to content

Conversation

gmarkall
Copy link
Member

@gmarkall gmarkall commented Jan 3, 2023

Only opened to try the code changes in #8620 with the original test matrix.

np.bool was removed in NumPy 1.24.
This always produced invalid results (though they were consistent
between Numba and NumPy) but now this fails in NumPy 1.24 with an
exception:

```
TypeError: The `dtype` and `signature` arguments to ufuncs only select
the general DType and not details such as the byte order or time unit.
You can avoid this error by using the scalar types `np.float64` or the
dtype string notation.
```

Note that the exception message is misleading, and using the dtype
string notation does not provide a workaround.
I believe this was written in error and should always have been float16.
The modified regex matches the existing message produced by NumPy <
1.24, and the new improved message in 1.24.
Setting an array element with a sequence is removed in NumPy 1.24.
This is so that a proper solution can be implemented.

This reverts commit 08416ad.
`init_ufunc_dispatch()` should set an exception if it's going to fail.
Without setting an exception, an unrecognized ufunc method (e.g.
`resolve_dtypes()` in NumPy 1.24) results in:

```
SystemError: initialization of _internal failed without raising an
exception
```

This commit modifies it to set an exception notifying the user of the
error. Now when an unrecognized ufunc method is encountered, the
traceback ends in:

```
    from numba.np.ufunc import _internal
RuntimeError: Unexpected ufunc method resolve_dtypes()
```
The Windows build did not like a variable-length stack array.
The API version has long since been greater than 0x7 / 0x8 for any
supported NumPy.
This test only checked for a plain match when comparing outputs.
However, in some cases a reconstruction check can be necessary, as in
`test_linalg_svd`.
@gmarkall gmarkall mentioned this pull request Jan 3, 2023
4 tasks
@gmarkall
Copy link
Member Author

gmarkall commented Jan 3, 2023

gpuci run tests

@gmarkall gmarkall mentioned this pull request Jan 3, 2023
@gmarkall
Copy link
Member Author

gpuci run tests

@stuartarchibald stuartarchibald added the abandoned PR is abandoned (no reason required) label Feb 15, 2023
@github-actions github-actions bot removed the abandoned PR is abandoned (no reason required) label Feb 16, 2023
@gmarkall
Copy link
Member Author

Now that #8691 is ready to go except for CI on that branch itself, I think this is no longer needed.

@gmarkall gmarkall closed this Feb 17, 2023
@gmarkall gmarkall added the abandoned PR is abandoned (no reason required) label Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abandoned PR is abandoned (no reason required)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants