Skip to content

Commit

Permalink
fix: compute device correctly (#129)
Browse files Browse the repository at this point in the history
Signed-off-by: Mehant Kammakomati <mehant.kammakomati2@ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
  • Loading branch information
kmehant authored Feb 27, 2025
1 parent 706d5cc commit 791bdd9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def augmentation(
rank, world_size = 0, 1
if torch.distributed.is_initialized():
world_size = torch.distributed.get_world_size()
rank = torch.distributed.get_rank()
# we do not need to use the fallback as this is wrapped in an `is_initialized` block
rank = torch.distributed.get_node_local_rank()

if not hasattr(model.config, "name_or_path") or not model.config.name_or_path:
raise ValueError(
Expand Down

0 comments on commit 791bdd9

Please sign in to comment.