Skip to content

Commit 5f430ce

Browse files
authored
Fix test_split_subview on Windows (#4808)
To avoid: `PermissionError: [Errno 13] Permission denied: '...\\AppData\\Local\\Temp\\tmp2t8ry39z.ttgir'` Signed-off-by: Anatoly Myachev <[email protected]>
1 parent 6067d4a commit 5f430ce

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

python/test/unit/language/test_core.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6487,7 +6487,7 @@ def test_local_load_store(M, N, K, dist_layout, shared_layout, device, tmp_path:
64876487

64886488
@pytest.mark.parametrize("M, N, M_tile_size, N_tile_size",
64896489
[[128, 128, 64, 64], [128, 128, 64, 32], [128, 64, 64, 32], [256, 128, 64, 64]])
6490-
def test_split_subview(M, N, M_tile_size, N_tile_size, device):
6490+
def test_split_subview(M, N, M_tile_size, N_tile_size, device, tmp_path: pathlib.Path):
64916491
num_rows_per_warp = THREADS_PER_WARP // 4
64926492
num_repeats_M = triton.cdiv(M, M_tile_size)
64936493
num_repeats_N = triton.cdiv(N, N_tile_size)
@@ -6546,11 +6546,9 @@ def test_split_subview(M, N, M_tile_size, N_tile_size, device):
65466546
}}
65476547
"""
65486548

6549-
import tempfile
6550-
with tempfile.NamedTemporaryFile(mode='w', suffix='.ttgir') as f:
6551-
f.write(ir)
6552-
f.flush()
6553-
kernel = triton.compile(f.name)
6549+
temp_file = tmp_path / "test_split_subview.ttgir"
6550+
temp_file.write_text(ir)
6551+
kernel = triton.compile(str(temp_file))
65546552

65556553
triton_result = torch.zeros((M, N), device=device, dtype=torch.float16)
65566554
kernel[(1, 1, 1)](triton_result.data_ptr())

0 commit comments

Comments
 (0)