Repository: pytorch
Issue: [tests] `cumprod` OpInfo tests take long time to run (around 1min)
Labels: module: ci,module: tests,triaged

**cumprod test logs with duration of slowest tests**

<details>

```
pytest test/test_ops.py -k _cumprod --durations=20
======================================================================= test session starts ========================================================================
platform linux -- Python 3.8.6, pytest-6.1.2, py-1.9.0, pluggy-0.13.1
rootdir: /home/kshiteej/Pytorch/pytorch_clamp_followup, configfile: pytest.ini
plugins: hypothesis-5.38.1
collected 11897 items / 11806 deselected / 91 selected                                                                                                             

test/test_ops.py .....s...........ssssssssssssssssss.....s...............ssssssssssss....sssss....ssssss....                                                 [100%]

========================================================================= warnings summary =========================================================================
======================================================================= slowest 20 durations =======================================================================
32.26s call     test/test_ops.py::TestGradientsCUDA::test_fn_gradgrad_cumprod_cuda_complex128
10.59s call     test/test_ops.py::TestGradientsCUDA::test_fn_gradgrad_cumprod_cuda_float64
9.96s call     test/test_ops.py::TestGradientsCPU::test_fn_gradgrad_cumprod_cpu_complex128
5.60s call     test/test_ops.py::TestCommonCUDA::test_variant_consistency_jit_cumprod_cuda_float32
4.99s call     test/test_ops.py::TestCommonCUDA::test_variant_consistency_jit_cumprod_cuda_complex64
3.47s call     test/test_ops.py::TestGradientsCPU::test_fn_gradgrad_cumprod_cpu_float64
2.76s call     test/test_ops.py::TestGradientsCUDA::test_fn_grad_cumprod_cuda_complex128
1.67s call     test/test_ops.py::TestCommonCPU::test_variant_consistency_jit_cumprod_cpu_complex64
1.46s call     test/test_ops.py::TestOpInfoCUDA::test_duplicate_method_tests_cumprod_cuda_float32
1.29s call     test/test_ops.py::TestGradientsCUDA::test_fn_grad_cumprod_cuda_float64
0.66s call     test/test_ops.py::TestCommonCPU::test_variant_consistency_jit_cumprod_cpu_float32
0.66s call     test/test_ops.py::TestGradientsCPU::test_fn_grad_cumprod_cpu_complex128
0.36s call     test/test_ops.py::TestOpInfoCUDA::test_supported_backward_cumprod_cuda_complex64
0.36s call     test/test_ops.py::TestOpInfoCUDA::test_supported_backward_cumprod_cuda_complex128
0.35s call     test/test_ops.py::TestOpInfoCUDA::test_supported_backward_cumprod_cuda_float16
0.35s call     test/test_ops.py::TestOpInfoCUDA::test_supported_backward_cumprod_cuda_float32
0.35s call     test/test_ops.py::TestOpInfoCUDA::test_supported_backward_cumprod_cuda_float64
0.26s call     test/test_ops.py::TestGradientsCPU::test_fn_grad_cumprod_cpu_float64
0.25s call     test/test_ops.py::TestOpInfoCUDA::test_supported_dtypes_cumprod_cuda_complex64
0.25s call     test/test_ops.py::TestOpInfoCUDA::test_supported_dtypes_cumprod_cuda_float16
============================================= 48 passed, 43 skipped, 11806 deselected, 5 warnings in 85.58s (0:01:25) ==============================================
```

</details>

**cumsum test log for reference**

<details>

```
pytest test/test_ops.py -k _cumsum --durations=20
======================================================================= test session starts ========================================================================
platform linux -- Python 3.8.6, pytest-6.1.2, py-1.9.0, pluggy-0.13.1
rootdir: /home/kshiteej/Pytorch/pytorch_clamp_followup, configfile: pytest.ini
plugins: hypothesis-5.38.1
collected 11897 items / 11814 deselected / 83 selected                                                                                                             

test/test_ops.py s....s...........ssssssssssssssss.....s...................ssss........s....ssss....                                                         [100%]

========================================================================= warnings summary =========================================================================
======================================================================= slowest 20 durations =======================================================================
4.27s call     test/test_ops.py::TestGradientsCUDA::test_inplace_gradgrad_cumsum_cuda_complex128
4.13s call     test/test_ops.py::TestGradientsCUDA::test_fn_gradgrad_cumsum_cuda_complex128
2.23s call     test/test_ops.py::TestCommonCUDA::test_variant_consistency_jit_cumsum_cuda_complex64
1.42s call     test/test_ops.py::TestOpInfoCUDA::test_duplicate_method_tests_cumsum_cuda_float32
1.38s call     test/test_ops.py::TestGradientsCUDA::test_inplace_gradgrad_cumsum_cuda_float64
1.34s call     test/test_ops.py::TestGradientsCUDA::test_fn_gradgrad_cumsum_cuda_float64
1.16s call     test/test_ops.py::TestCommonCPU::test_variant_consistency_jit_cumsum_cpu_complex64
1.05s call     test/test_ops.py::TestGradientsCPU::test_fn_gradgrad_cumsum_cpu_complex128
1.04s call     test/test_ops.py::TestGradientsCPU::test_inplace_gradgrad_cumsum_cpu_complex128
0.79s call     test/test_ops.py::TestGradientsCUDA::test_fn_grad_cumsum_cuda_complex128
0.74s call     test/test_ops.py::TestGradientsCUDA::test_inplace_grad_cumsum_cuda_complex128
0.63s call     test/test_ops.py::TestCommonCUDA::test_variant_consistency_jit_cumsum_cuda_float32
0.42s call     test/test_ops.py::TestGradientsCUDA::test_inplace_grad_cumsum_cuda_float64
0.40s call     test/test_ops.py::TestGradientsCUDA::test_fn_grad_cumsum_cuda_float64
0.37s call     test/test_ops.py::TestOpInfoCUDA::test_supported_backward_cumsum_cuda_complex128
0.35s call     test/test_ops.py::TestOpInfoCUDA::test_supported_backward_cumsum_cuda_float32
0.35s call     test/test_ops.py::TestOpInfoCUDA::test_supported_backward_cumsum_cuda_complex64
0.34s call     test/test_ops.py::TestOpInfoCUDA::test_supported_backward_cumsum_cuda_float16
0.32s call     test/test_ops.py::TestOpInfoCUDA::test_supported_backward_cumsum_cuda_float64
0.31s call     test/test_ops.py::TestGradientsCPU::test_inplace_gradgrad_cumsum_cpu_float64

================================================== 55 passed, 28 skipped, 11814 deselected, 5 warnings in 31.58s ===================================================
```

</details>

cc @ezyang @seemethere @malfet @walterddr @pytorch/pytorch-dev-infra @mruberry @VitalyFedyunin