create is_in_the_same_node on cpu (#26832)

Co-authored-by: Lunwen He <lunwenh@meta.com>
This commit is contained in:
Lunwen He
2025-10-21 02:04:14 +00:00
committed by GitHub
co-authored by Lunwen He
parent 163965d183
commit 0eb8f2b880
4 changed files with 26 additions and 8 deletions
+3 -1
View File
@@ -1526,7 +1526,9 @@ def in_the_same_node_as(
ranks = list(range(world_size))
# local tensor in each process to store the result
is_in_the_same_node = torch.tensor([0] * world_size, dtype=torch.int32)
is_in_the_same_node = torch.tensor(
[0] * world_size, dtype=torch.int32, device="cpu"
)
magic_message = b"magic_message"
shm = None