Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
oahzxl committed Dec 11, 2023
1 parent 64b214f commit 4dc4852
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion colossalai/accelerator/cuda_accelerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def set_device(self, device: Union[torch.device, int]) -> None:
"""
if device is None:
if not dist.is_initialized():
raise RuntimeError("Cannot get current device when distributed is not initialized")
raise RuntimeError("Cannot get current device when distributed is not initialized.")
device = dist.get_rank() % self.device_count()
torch.cuda.set_device(device)

Expand Down
2 changes: 1 addition & 1 deletion colossalai/accelerator/npu_accelerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def set_device(self, device: Union[torch.device, int]) -> None:
"""
if device is None:
if not dist.is_initialized():
raise RuntimeError("Cannot get current device when distributed is not initialized")
raise RuntimeError("Cannot get current device when distributed is not initialized.")
device = dist.get_rank() % self.device_count()
torch.npu.set_device(device)

Expand Down

0 comments on commit 4dc4852

Please sign in to comment.