Repository: pytorch
Issue: DISABLED test_serialization_array_with_storage (__main__.TestCuda)
Labels: module: cuda,triaged,module: flaky-tests,skipped

Platforms: linux

This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_serialization_array_with_storage&suite=TestCuda&limit=100) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/29586769088).

Over the past 3 hours, it has been determined flaky in 4 workflow(s) with 12 failures and 4 successes.

**Debugging instructions (after clicking on the recent samples link):**
DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs.
To find relevant log snippets:
1. Click on the workflow logs linked above
2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work.
3. Grep for `test_serialization_array_with_storage`
4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs.



<details><summary>Sample error message</summary>

```
Traceback (most recent call last):
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_comparison.py", line 1159, in originate_pairs
    return [pair_type(actual, expected, id=id, **options)]
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 2677, in __init__
    super().__init__(actual, expected, **other_parameters)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_comparison.py", line 649, in __init__
    actual, expected = self._process_inputs(
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_comparison.py", line 675, in _process_inputs
    actual, expected = (self._to_tensor(input) for input in (actual, expected))
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_comparison.py", line 675, in <genexpr>
    actual, expected = (self._to_tensor(input) for input in (actual, expected))
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 2682, in _to_tensor
    return torch.tensor(
ValueError: could not determine the shape of object type 'torch.storage.UntypedStorage'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/test/test_cuda.py", line 392, in test_serialization_array_with_storage
    self.assertEqual(q_copy, q, atol=0, rtol=0)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 3846, in assertEqual
    error_metas = not_close_error_metas(
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_comparison.py", line 1217, in not_close_error_metas
    pairs = originate_pairs(
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_comparison.py", line 1108, in originate_pairs
    originate_pairs(
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_comparison.py", line 1172, in originate_pairs
    f"Originating a {pair_type.__name__}() at item {''.join(str([item]) for item in id)} with\n\n"
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/storage.py", line 1097, in __str__
    data_str = " " + "\n ".join(str(self[i]) for i in range(self.size()))
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/storage.py", line 1097, in <genexpr>
    data_str = " " + "\n ".join(str(self[i]) for i in range(self.size()))
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/storage.py", line 956, in __getitem__
    return self._getitem(idx)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/storage.py", line 1000, in _getitem
    return tmp_tensor[idx_wrapped].item()
RuntimeError: Host and device pointer dont match with cudaHostRegister. Please dont use this feature by setting PYTORCH_CUDA_ALLOC_CONF=use_cuda_host_register:False (default)

To execute this test, run the following from the base repo dir:
    python test/test_cuda.py TestCuda.test_serialization_array_with_storage

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0
```

</details>


Test file path: `test_cuda.py`

cc @ptrblck @msaroufim @clee2000