Skip to content

Commit 22ff4be

Browse files
committed
Comment why we ignore some spurious matmul RuntimeWarnings on macOS arm64
1 parent fe542c3 commit 22ff4be

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

bench/ndarray/matmul_path_compare.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def run_case(
6969
):
7070
a, b, a_np, b_np = build_arrays(shape_a, shape_b, dtype, chunks_a, chunks_b, blocks_a, blocks_b)
7171
with warnings.catch_warnings():
72+
# NumPy + Accelerate can emit spurious matmul RuntimeWarnings on macOS arm64.
7273
warnings.simplefilter("ignore", RuntimeWarning)
7374
expected = np.matmul(a_np, b_np)
7475
original_flag = set_path_mode(mode)
@@ -87,6 +88,7 @@ def wrapped_set_pref_matmul(self, inputs, fp_accuracy):
8788
before = len(selected_paths)
8889
t0 = time.perf_counter()
8990
with warnings.catch_warnings():
91+
# NumPy + Accelerate can emit spurious matmul RuntimeWarnings on macOS arm64.
9092
warnings.simplefilter("ignore", RuntimeWarning)
9193
result = blosc2.matmul(a, b, chunks=chunks_out, blocks=blocks_out)
9294
times.append(time.perf_counter() - t0)

tests/ndarray/test_linalg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def test_matmul_uses_fast_path_for_supported_2d(monkeypatch, dtype):
108108
b = blosc2.full(shape=(400, 400), fill_value=2, dtype=dtype, chunks=(200, 200), blocks=(100, 100))
109109

110110
with warnings.catch_warnings():
111+
# NumPy + Accelerate can emit spurious matmul RuntimeWarnings on macOS arm64.
111112
warnings.simplefilter("ignore", RuntimeWarning)
112113
c = blosc2.matmul(a, b, chunks=(200, 200), blocks=(100, 100))
113114
expected = np.matmul(a[:], b[:])

0 commit comments

Comments
 (0)