From 17bf59340caebf4f7de3cdebe08dcd3d1cc272cd Mon Sep 17 00:00:00 2001 From: eqy Date: Wed, 16 Apr 2025 18:44:18 +0000 Subject: [PATCH] [cuSPARSE][B200] Bump tolerances for test_sparse_csr matvec (#148721) Small tolerance bump for blackwell (appears to use same kernel as prev. arches) Pull Request resolved: https://github.com/pytorch/pytorch/pull/148721 Approved by: https://github.com/nWEIdia, https://github.com/ngimel --- test/test_sparse_csr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test_sparse_csr.py b/test/test_sparse_csr.py index 4ef62c9184d..9fd8df81f80 100644 --- a/test/test_sparse_csr.py +++ b/test/test_sparse_csr.py @@ -1495,7 +1495,8 @@ class TestSparseCSR(TestCase): res = csr.matmul(vec) expected = csr.to_dense().matmul(vec) - self.assertEqual(res, expected) + atol, rtol = (2e-3, 1e-3) if dtype == torch.half else (None, None) + self.assertEqual(res, expected, atol=atol, rtol=rtol) bad_vec = torch.randn(side + 10, dtype=dtype, device=device) err_msg = "size mismatch, got"