Skip to content

Commit

Permalink
Fix wrong device access in get_lst_from_rank0
Browse files Browse the repository at this point in the history
  • Loading branch information
nelyahu committed Mar 27, 2024
1 parent 254a27d commit b118467
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deepspeed/runtime/zero/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def get_lst_from_rank0(lst: List[int]) -> None:
lst_tensor = torch.tensor(
lst if dist.get_rank() == 0 else [-1] * len(lst),
dtype=int,
device=get_accelerator().device(os.environ["LOCAL_RANK"]),
device=torch.device(get_accelerator().device_name(os.environ["LOCAL_RANK"])),
requires_grad=False,
)
dist.broadcast(lst_tensor, src=0, async_op=False)
Expand Down

0 comments on commit b118467

Please sign in to comment.