Skip to content

Commit

Permalink
Enable test_optimize_thread_locality for CPU.
Browse files Browse the repository at this point in the history
Signed-off-by: Ilya Enkovich <[email protected]>
  • Loading branch information
ienkovich committed Jun 20, 2024
1 parent 3cc220e commit fed2011
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/test/unit/language/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2468,6 +2468,7 @@ def histogram_kernel(x_ptr, z_ptr, M: tl.constexpr, N: tl.constexpr):
assert (z_torch == z).all()


@pytest.mark.cpu
@pytest.mark.interpreter
@pytest.mark.parametrize("op", ['sum', 'max', 'min'])
@pytest.mark.parametrize("BLOCK_N", [32, 64, 128])
Expand Down Expand Up @@ -2513,7 +2514,7 @@ def kernel(X, Y, N, BLOCK_M: tl.constexpr, BLOCK_N: tl.constexpr, NUM_PID_N: tl.
x = torch.randn((BLOCK_M, N), dtype=torch.float32, device=device)
y = torch.randn((BLOCK_M, num_pid_n), dtype=torch.float32, device=device)
h = kernel[(1, num_pid_n, 1)](x, y, N, BLOCK_M, BLOCK_N, NUM_PID_N=num_pid_n)
if not is_interpreter():
if not is_interpreter() and not is_cpu():
assert h.asm['ttgir'].count(
'"tt.reduce"') == 2, "tt.reduce should be called twice, otherwise the optimization didn't work"
y_ref = numpy_op(x.cpu().numpy(), axis=1, keepdims=True)
Expand Down

0 comments on commit fed2011

Please sign in to comment.