Skip to content

Commit 58e0ccd

Browse files
committed
Fix fp8 matmul test flake on hopper
Signed-off-by: Jay Gu <jagu@nvidia.com>
1 parent f20e5cd commit 58e0ccd

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

test/test_mma.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,17 +280,15 @@ def test_matmul_fp8(tile_size, dtype):
280280
scale = torch.tensor([1.0], dtype=torch.float32, device="cuda")
281281
try:
282282
ref = torch._scaled_mm(A, B.T, scale, scale,
283-
out_dtype=torch.float16, use_fast_accum=True).to(dtype)
283+
out_dtype=torch.float16, use_fast_accum=True)
284284
except (RuntimeError, ValueError) as e:
285285
assert 'Multiplication of two Float8_e5m2 matrices is not supported' in str(e)
286286
ref = None
287287
ct.launch(torch.cuda.current_stream(), (1,), matmul_kernel,
288288
(A, B.T, C, m, n, k))
289289
if ref is not None:
290-
atol, rtol = get_tolerance(A.dtype)
291-
assert_close(C.to(torch.float16),
292-
ref.to(torch.float16),
293-
atol=atol, rtol=rtol)
290+
atol, rtol = 0.1, 0.1
291+
assert_close(C.to(torch.float16), ref, atol=atol, rtol=rtol)
294292

295293

296294
@pytest.mark.parametrize("tile_size", [(16, 16, 16)])

0 commit comments

Comments
 (0)