|
30 | 30 | class TestFakeTensorQuantCuda(FakeTensorQuantTester): |
31 | 31 | device = "cuda" |
32 | 32 |
|
33 | | - def test_non_current_gpu(self, need_2_gpus): |
34 | | - device = torch.cuda.device_count() - 1 |
35 | | - assert torch.cuda.current_device() != device |
36 | | - x = torch.randn(3, 4).cuda(device) |
37 | | - quant_x = tensor_quant.fake_tensor_quant(x, torch.max(torch.abs(x)), None) |
38 | | - quant_x_ref = quant(x, torch.max(torch.abs(x)), fake=True) |
39 | | - assert torch.allclose(quant_x, quant_x_ref) |
40 | | - |
41 | 33 |
|
42 | 34 | class TestCudaExt: |
43 | 35 | @pytest.mark.parametrize("num_bits", [3, 4, 5, 7, 8, 11]) |
@@ -145,15 +137,6 @@ def test_backward(self, device): |
145 | 137 | loss.backward() |
146 | 138 | assert torch.allclose(quant_x.grad, x.grad) |
147 | 139 |
|
148 | | - def test_non_current_gpu(self, need_2_gpus): |
149 | | - torch.cuda.set_device(0) |
150 | | - device = torch.cuda.device_count() - 1 |
151 | | - x = torch.randn(3, 4).cuda() |
152 | | - quant_x_ref = tensor_quant.fp8_eager(x, torch.tensor(448.0, device=x.device)) |
153 | | - x = x.cuda(device) |
154 | | - quant_x = tensor_quant.scaled_e4m3(x, None, None, 4, 3) |
155 | | - assert torch.allclose(quant_x.cuda(), quant_x_ref) |
156 | | - |
157 | 140 | @pytest.mark.parametrize("axis", [0, 1, 2]) |
158 | 141 | def test_e4m3_per_channel(self, axis): |
159 | 142 | x = torch.randn(4, 4, 4, dtype=torch.float32).cuda() |
|
0 commit comments