Skip to content

Commit 2ffa677

Browse files
committed
Adjust tolerance for matmul sample test
Signed-off-by: Jay Gu <jagu@nvidia.com>
1 parent aa328f3 commit 2ffa677

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

samples/MatMul.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def cutile_matmul(A: torch.Tensor, B: torch.Tensor, persistent: bool = False) ->
298298
C_fp32_cutile = cutile_matmul(A_fp32, B_fp32)
299299
print(f"cuTile Output C shape: {C_fp32_cutile.shape}, dtype: {C_fp32_cutile.dtype}")
300300
if args.correctness_check:
301-
torch.testing.assert_close(C_fp32_cutile, A_fp32 @ B_fp32, atol=1e-5, rtol=1e-3)
301+
torch.testing.assert_close(C_fp32_cutile, A_fp32 @ B_fp32, atol=2e-5, rtol=1e-3)
302302
print("Correctness check passed")
303303
else:
304304
print("Correctness check disabled")
@@ -319,7 +319,7 @@ def cutile_matmul(A: torch.Tensor, B: torch.Tensor, persistent: bool = False) ->
319319
C_non_mult_cutile = cutile_matmul(A_non_mult, B_non_mult)
320320
print(f"cuTile Output C shape: {C_non_mult_cutile.shape}, dtype: {C_non_mult_cutile.dtype}")
321321
if args.correctness_check:
322-
torch.testing.assert_close(C_non_mult_cutile, A_non_mult @ B_non_mult, atol=1e-5, rtol=1e-3)
322+
torch.testing.assert_close(C_non_mult_cutile, A_non_mult @ B_non_mult, atol=2e-5, rtol=1e-3)
323323
print("Correctness check passed")
324324
else:
325325
print("Correctness check disabled")
@@ -330,7 +330,7 @@ def cutile_matmul(A: torch.Tensor, B: torch.Tensor, persistent: bool = False) ->
330330
print(f"cuTile Output C shape: {C_persistent_fp32_cutile.shape}, "
331331
f"dtype: {C_persistent_fp32_cutile.dtype}")
332332
if args.correctness_check:
333-
torch.testing.assert_close(C_persistent_fp32_cutile, A_fp32 @ B_fp32, atol=1e-5, rtol=1e-3)
333+
torch.testing.assert_close(C_persistent_fp32_cutile, A_fp32 @ B_fp32, atol=2e-5, rtol=1e-3)
334334
print("Correctness check passed")
335335
else:
336336
print("Correctness check disabled")

samples/templates/MatMul.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def cutile_matmul(A: torch.Tensor, B: torch.Tensor, persistent: bool = False) ->
131131
C_fp32_cutile = cutile_matmul(A_fp32, B_fp32)
132132
print(f"cuTile Output C shape: {C_fp32_cutile.shape}, dtype: {C_fp32_cutile.dtype}")
133133
if args.correctness_check:
134-
torch.testing.assert_close(C_fp32_cutile, A_fp32 @ B_fp32, atol=1e-5, rtol=1e-3)
134+
torch.testing.assert_close(C_fp32_cutile, A_fp32 @ B_fp32, atol=2e-5, rtol=1e-3)
135135
print("Correctness check passed")
136136
else:
137137
print("Correctness check disabled")
@@ -152,7 +152,7 @@ def cutile_matmul(A: torch.Tensor, B: torch.Tensor, persistent: bool = False) ->
152152
C_non_mult_cutile = cutile_matmul(A_non_mult, B_non_mult)
153153
print(f"cuTile Output C shape: {C_non_mult_cutile.shape}, dtype: {C_non_mult_cutile.dtype}")
154154
if args.correctness_check:
155-
torch.testing.assert_close(C_non_mult_cutile, A_non_mult @ B_non_mult, atol=1e-5, rtol=1e-3)
155+
torch.testing.assert_close(C_non_mult_cutile, A_non_mult @ B_non_mult, atol=2e-5, rtol=1e-3)
156156
print("Correctness check passed")
157157
else:
158158
print("Correctness check disabled")
@@ -163,7 +163,7 @@ def cutile_matmul(A: torch.Tensor, B: torch.Tensor, persistent: bool = False) ->
163163
print(f"cuTile Output C shape: {C_persistent_fp32_cutile.shape}, "
164164
f"dtype: {C_persistent_fp32_cutile.dtype}")
165165
if args.correctness_check:
166-
torch.testing.assert_close(C_persistent_fp32_cutile, A_fp32 @ B_fp32, atol=1e-5, rtol=1e-3)
166+
torch.testing.assert_close(C_persistent_fp32_cutile, A_fp32 @ B_fp32, atol=2e-5, rtol=1e-3)
167167
print("Correctness check passed")
168168
else:
169169
print("Correctness check disabled")

0 commit comments

Comments
 (0)