Repository: pytorch
Issue: TestForeachCUDA.test_binary_op_tensorlists_fastpath__foreach_add_cuda_bool and TestForeachCUDA.test_pointwise_op_fastpath__foreach_addcmul_cuda_uint8 fail intermittently
Labels: module: cuda,module: tests,triaged,module: mta

See https://github.com/pytorch/pytorch/runs/3998897949?check_suite_focus=true. Relevant snippet:

```
TestForeachCUDA.test_binary_op_tensorlists_fastpath__foreach_add_cuda_bool

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 1422, in wrapper
    method(*args, **kwargs)
  File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 1422, in wrapper
    method(*args, **kwargs)
  File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 371, in instantiated_test
    result = test(self, **param_kwargs)
  File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 737, in test_wrapper
    return test(*args, **kwargs)
  File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 772, in dep_fn
    return fn(slf, *args, **kwargs)
  File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 772, in dep_fn
    return fn(slf, *args, **kwargs)
  File "test_foreach.py", line 179, in test_binary_op_tensorlists_fastpath
    self._test_binary_op_tensorlists(device, dtype, op, N, True, disable_fastpath)
  File "test_foreach.py", line 136, in _test_binary_op_tensorlists
    self._binary_test(dtype, inplace_op, inplace_ref, inputs, is_fastpath, is_inplace=True)
  File "test_foreach.py", line 106, in _binary_test
    actual = op(inputs, self.is_cuda, is_fastpath)
  File "test_foreach.py", line 78, in __call__
    assert e.count == self.n_expected_cudaLaunchKernels
AssertionError
		

TestForeachCUDA.test_pointwise_op_fastpath__foreach_addcmul_cuda_uint8

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 1422, in wrapper
    method(*args, **kwargs)
  File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 1422, in wrapper
    method(*args, **kwargs)
  File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 371, in instantiated_test
    result = test(self, **param_kwargs)
  File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 737, in test_wrapper
    return test(*args, **kwargs)
  File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 772, in dep_fn
    return fn(slf, *args, **kwargs)
  File "test_foreach.py", line 309, in test_pointwise_op_fastpath
    self._test_pointwise_op(device, dtype, op, N, True, disable_fastpath, values=scalar)
  File "test_foreach.py", line 285, in _test_pointwise_op
    self._pointwise_test(dtype, inplace_op, inplace_ref, inputs, is_fastpath, is_inplace=True, values=values)
  File "test_foreach.py", line 259, in _pointwise_test
    actual = op(inputs, self.is_cuda, is_fastpath)
  File "test_foreach.py", line 78, in __call__
    assert e.count == self.n_expected_cudaLaunchKernels
AssertionError
```

cc @ngimel @mruberry @crcrpar @mcarilli