Skip to content

Commit

Permalink
Fix test_bin_op in NumPy 2.0 (#5541)
Browse files Browse the repository at this point in the history
`_set_promotion_state` is removed in NumPy 2.0. We just turn the
contextmanager into a noop when the user has a newer NumPy version.

I tested this locally. At some point we should add NumPy 2.0 support to
CI, I guess.
  • Loading branch information
lezcano authored Jan 6, 2025
1 parent f35eb5b commit d13a040
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/test/unit/language/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ def promotion_numpy_2_0():
np._set_promotion_state(state)


# No need to emulate NumPy 2.0 if the user has NumPy 2.0
if np.__version__[0] != "1":
promotion_numpy_2_0 = contextlib.nullcontext

# TODO: enable multiple cta cluster testing.
# num_ctas_list = [1, 4] if torch.cuda.get_device_capability()[0] == 9 else [1]
num_ctas_list = [1]
Expand Down

0 comments on commit d13a040

Please sign in to comment.