Reduce number of samples in {svd,pca}_lowrank OpInfos (#127199)

We don't need to generate so many samples for these very expensive ops.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/127199
Approved by: https://github.com/peterbell10, https://github.com/zou3519
This commit is contained in:
lezcano 2024-07-17 09:20:35 +00:00 committed by PyTorch MergeBot
parent 6e916f112f
commit af0b5ee924
2 changed files with 7 additions and 16 deletions

View File

@ -457,11 +457,7 @@ class TestOperators(TestCase):
{torch.float32: tol(atol=1e-04, rtol=1e-04)},
),
tol1("masked.cumprod", {torch.float32: tol(atol=1e-05, rtol=1e-05)}),
tol1(
"svd_lowrank",
{torch.float32: tol(atol=3e-04, rtol=3e-04)},
device_type="cuda",
),
tol1("svd_lowrank", {torch.float32: tol(atol=3e-04, rtol=3e-04)}),
tol1(
"linalg.multi_dot",
{torch.float32: tol(atol=1e-05, rtol=8e-04)},

View File

@ -2108,14 +2108,13 @@ def sample_inputs_singular_matrix_factors(op_info, device, dtype, requires_grad=
"""
make_arg = partial(make_tensor, device=device, dtype=dtype, requires_grad=requires_grad)
batches = [(), (0, ), (2, ), (1, 1)]
size = [1, 5, 10]
batches = [(), (2,)]
size = [3, 4]
for batch, m, n in product(batches, size, size):
for k in range(min(3, m, n)):
a = make_arg((*batch, m, k))
b = make_arg((*batch, n, k))
yield a, b
k = 2
a = make_arg((*batch, m, k))
b = make_arg((*batch, n, k))
yield a, b
def sample_inputs_svd_lowrank(op_info, device, dtype, requires_grad=False, **kwargs):
@ -17980,10 +17979,6 @@ op_db: List[OpInfo] = [
'TestFwdGradients',
'test_fn_fwgrad_bwgrad',
dtypes=[torch.complex128]),
DecorateInfo(unittest.skip("See comment above"),
'TestBwdGradientsCUDA',
'test_fn_gradgrad',
dtypes=[torch.complex128]),
],
skips=(
# test does not work with passing lambda for op