mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
Revert "Increased compile time max GPUs to 512. Switched to int16_t DeviceIndex. (#119639)"
This reverts commit 7c556428c74a79c6d9c272826344a0828d3f66f5. Reverted https://github.com/pytorch/pytorch/pull/119639 on behalf of https://github.com/kit1980 due to breaking internal builds, see D54286923 ([comment](https://github.com/pytorch/pytorch/pull/119639#issuecomment-1969634480))
This commit is contained in:
@ -1017,22 +1017,6 @@ class TestDeviceUtils(TestCase):
|
||||
tree_all_only(torch.Tensor, lambda x: x.device.type == 'meta', r)
|
||||
)
|
||||
|
||||
def test_int16_device_index(self):
|
||||
# Test if index does not wrap around when larger than int8
|
||||
large_index = 500
|
||||
x = torch.device('meta', large_index)
|
||||
self.assertEqual(x.index, large_index)
|
||||
|
||||
def test_raise_on_device_index_out_of_bounds(self):
|
||||
# Tests if an error is raised when the device index is out of bounds
|
||||
index_larger_than_max = 100000
|
||||
error_msg_regex = "^Device index must be.*"
|
||||
# Explicit index
|
||||
with self.assertRaisesRegex(RuntimeError, error_msg_regex):
|
||||
x = torch.device('meta', index=index_larger_than_max)
|
||||
# Index in device string
|
||||
with self.assertRaisesRegex(RuntimeError, error_msg_regex):
|
||||
x = torch.device(f'meta:{index_larger_than_max}')
|
||||
|
||||
instantiate_device_type_tests(TestDeviceUtils, globals())
|
||||
|
||||
|
Reference in New Issue
Block a user