[Refactor] Replace and ban a few torch.cuda functions in favor of torch.accelerator replacements. (#3365)
Signed-off-by: Nick Cao <ncao@redhat.com>
This commit is contained in:
1 parent
54277a8dd0
commit
e6466cf0e6
40 files changed
+98
-90
No files matched your search
@@ -49,7 +49,7 @@ def get_gpu_info() -> list[dict]:
|
||||
|
||||
if not torch.cuda.is_available():
|
||||
return []
|
||||
for i in range(torch.cuda.device_count()):
|
||||
for i in range(torch.accelerator.device_count()):
|
||||
free, total = torch.cuda.mem_get_info(i)
|
||||
props = torch.cuda.get_device_properties(i)
|
||||
gpus.append(
|
||||
|
||||
Reference in new issue
Block a user