|
17 | 17 | from itertools import product
|
18 | 18 | from random import randint
|
19 | 19 |
|
20 |
| -import psutil |
21 |
| - |
22 | 20 | import torch
|
23 | 21 | import torch.cuda
|
24 | 22 | from torch import inf, nan
|
|
64 | 62 | skipIfRocm,
|
65 | 63 | slowTest,
|
66 | 64 | subtest,
|
67 |
| - TemporaryFileName, |
68 | 65 | TEST_CUDA,
|
69 | 66 | TEST_CUDA_GRAPH,
|
70 | 67 | TEST_NUMPY,
|
@@ -4025,15 +4022,6 @@ def test_device_count_not_cached_pre_init(self):
|
4025 | 4022 | x = torch.cuda.device_count()
|
4026 | 4023 | self.assertEqual(f"{x}, 1", r)
|
4027 | 4024 |
|
4028 |
| - def test_gds_fails_in_ci(self): |
4029 |
| - if IS_WINDOWS or TEST_WITH_ROCM: |
4030 |
| - error_msg = "is not supported on this platform" |
4031 |
| - else: |
4032 |
| - error_msg = "cuFileHandleRegister failed" |
4033 |
| - with TemporaryFileName() as f: |
4034 |
| - with self.assertRaisesRegex(RuntimeError, error_msg): |
4035 |
| - file = torch.cuda.gds._GdsFile(f, os.O_CREAT | os.O_RDWR) |
4036 |
| - |
4037 | 4025 |
|
4038 | 4026 | @torch.testing._internal.common_utils.markDynamoStrictTest
|
4039 | 4027 | class TestCudaMallocAsync(TestCase):
|
@@ -5181,40 +5169,6 @@ def test_graph_grad_scaling(self, device, dtype, optim_info, foreach, fused):
|
5181 | 5169 | self.assertEqual(scaler._growth_tracker, growth_tracker)
|
5182 | 5170 |
|
5183 | 5171 |
|
5184 |
| -class TestGDS(TestCase): |
5185 |
| - def _get_tmp_dir_fs_type(self): |
5186 |
| - my_path = os.path.realpath("/tmp") |
5187 |
| - root_type = "" |
5188 |
| - for part in psutil.disk_partitions(): |
5189 |
| - if part.mountpoint == "/": |
5190 |
| - root_type = part.fstype |
5191 |
| - continue |
5192 |
| - if part.mountpoint == my_path: |
5193 |
| - return part.fstype |
5194 |
| - return root_type |
5195 |
| - |
5196 |
| - @unittest.skipIf(IS_WINDOWS or TEST_WITH_ROCM, "Not supported on Windows or ROCm") |
5197 |
| - def test_gds_read_write_tensors(self): |
5198 |
| - if self._get_tmp_dir_fs_type() not in ("ext4", "xfs"): |
5199 |
| - self.skipTest("GPUDirect Storage requires ext4/xfs for local filesystem") |
5200 |
| - src1 = torch.randn(1024, device="cuda") |
5201 |
| - src2 = torch.randn(2, 1024, device="cuda") |
5202 |
| - torch.cuda.gds._gds_register_buffer(src1.untyped_storage()) |
5203 |
| - torch.cuda.gds._gds_register_buffer(src2.untyped_storage()) |
5204 |
| - dest1 = torch.empty(1024, device="cuda") |
5205 |
| - dest2 = torch.empty(2, 1024, device="cuda") |
5206 |
| - with TemporaryFileName() as f: |
5207 |
| - file = torch.cuda.gds._GdsFile(f, os.O_CREAT | os.O_RDWR) |
5208 |
| - file.save_storage(src1.untyped_storage(), offset=0) |
5209 |
| - file.save_storage(src2.untyped_storage(), offset=src1.nbytes) |
5210 |
| - file.load_storage(dest1.untyped_storage(), offset=0) |
5211 |
| - file.load_storage(dest2.untyped_storage(), offset=src1.nbytes) |
5212 |
| - self.assertEqual(src1, dest1) |
5213 |
| - self.assertEqual(src2, dest2) |
5214 |
| - torch.cuda.gds._gds_deregister_buffer(src1.untyped_storage()) |
5215 |
| - torch.cuda.gds._gds_deregister_buffer(src2.untyped_storage()) |
5216 |
| - |
5217 |
| - |
5218 | 5172 | instantiate_parametrized_tests(TestCuda)
|
5219 | 5173 | instantiate_parametrized_tests(TestCudaMallocAsync)
|
5220 | 5174 | instantiate_device_type_tests(TestCudaOptims, globals())
|
|
0 commit comments