mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Cleanup DeviceInterface in triton test (#152409)
- Remove inherited functions - Return valid device_count (1 device: idx=0) - Remove unused function `triton_supported` Followup to #144399 Pull Request resolved: https://github.com/pytorch/pytorch/pull/152409 Approved by: https://github.com/jansel
This commit is contained in:
parent
44f29a3669
commit
74b496e54c
|
|
@ -76,7 +76,7 @@ class DeviceInterface(device_interface.DeviceInterface):
|
|||
|
||||
@staticmethod
|
||||
def device_count() -> int:
|
||||
raise NotImplementedError
|
||||
return 1
|
||||
|
||||
@staticmethod
|
||||
def maybe_exchange_device(device: int) -> int:
|
||||
|
|
@ -92,14 +92,6 @@ class DeviceInterface(device_interface.DeviceInterface):
|
|||
), f"Only device index 0 is supported, tried to set index to {device}"
|
||||
return 0 # previous device is always 0
|
||||
|
||||
@staticmethod
|
||||
def current_stream():
|
||||
raise NotImplementedError
|
||||
|
||||
@staticmethod
|
||||
def set_stream(stream) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
@staticmethod
|
||||
def get_raw_stream(device_index: int):
|
||||
return None
|
||||
|
|
@ -108,10 +100,6 @@ class DeviceInterface(device_interface.DeviceInterface):
|
|||
def synchronize(device) -> None:
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def get_device_properties(cls, device=None) -> DeviceProperties:
|
||||
return cls.Worker.get_device_properties(device)
|
||||
|
||||
# Can be mock patched by @patch decorator.
|
||||
@staticmethod
|
||||
def is_available() -> bool:
|
||||
|
|
@ -120,7 +108,3 @@ class DeviceInterface(device_interface.DeviceInterface):
|
|||
@staticmethod
|
||||
def get_compute_capability(device) -> int:
|
||||
return 0
|
||||
|
||||
@staticmethod
|
||||
def triton_supported() -> bool:
|
||||
return True
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user