We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb18d8a commit 2a8f9e9Copy full SHA for 2a8f9e9
torch_xla/runtime.py
@@ -156,7 +156,8 @@ def local_ordinal() -> int:
156
Local ordinal is in range [0, local_device_count)."""
157
local_rank = xu.getenv_as(xenv.PJRT_LOCAL_PROCESS_RANK, int, 0)
158
devices_per_process = addressable_device_count()
159
- return local_rank * devices_per_process + torch.device('xla').index
+ return local_rank * devices_per_process + torch.device(
160
+ torch_xla._XLAC._xla_get_default_device()).index
161
162
163
def process_index() -> int:
0 commit comments