Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/pytorch/language-modeling/run_clm.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def main():
import torch_xla.core.xla_model as xm
import torch_xla.experimental.xla_sharding as xs
import torch_xla.runtime as xr
num_devices = xr.global_device_count()
num_devices = xr.global_runtime_device_count()
device_ids = torch.arange(num_devices)
print('Using dtype', model_args.torch_dtype)
model = model.to(xm.xla_device(), dtype=getattr(torch, model_args.torch_dtype))
Expand Down
2 changes: 1 addition & 1 deletion src/transformers/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ def _xla_sharded_dataloader(self, dataloader):
import torch_xla.experimental.xla_sharding as xs
import torch_xla.runtime as xr
import torch_xla.distributed.parallel_loader as pl
num_devices = xr.global_device_count()
num_devices = xr.global_runtime_device_count()
device_ids = np.arange(num_devices)

sharding_spec = None
Expand Down