[Refactor] Replace hardcoded CUDA device selection with platform-agnostic API (#4496)

Signed-off-by: Nick Cao <ncao@redhat.com>
This commit is contained in:
Nick Cao authored and GitHub committed 2026-06-23 14:38:32 +08:00
1 parent 64efa66869
commit 67d14b5ac4
15 files changed
+34 -16

No files matched your search

+4
View File
@@ -248,6 +248,10 @@ class UnspecifiedOmniPlatform(OmniPlatform):
_enum = PlatformEnum.UNSPECIFIED
device_type = "cpu"
@classmethod
def get_torch_device(cls, local_rank: int | None = None) -> torch.device:
return torch.device("cpu")
@classmethod
def get_device_count(cls) -> int:
return 0