Skip to content

Commit cf381e0

Browse files
committed
cuda to accelerator
1 parent 4b3abaa commit cf381e0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

distributed/tensor_parallelism/log_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ def rank_log(_rank, logger, msg):
1717

1818
def verify_min_gpu_count(min_gpus: int = 2) -> bool:
1919
""" verification that we have at least 2 gpus to run dist examples """
20-
has_cuda = torch.cuda.is_available()
21-
gpu_count = torch.cuda.device_count()
22-
return has_cuda and gpu_count >= min_gpus
20+
has_gpu = torch.accelerator.is_available()
21+
gpu_count = torch.accelerator.device_count()
22+
return has_gpu and gpu_count >= min_gpus

distributed/tensor_parallelism/tensor_parallel_example.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# torchrun --nnodes 1 --nproc-per-node 4 <fn>
12
import os
23
import sys
34
import torch

0 commit comments

Comments
 (0)