From f853293440ade5f95df63483d7d46fe307a6e6e7 Mon Sep 17 00:00:00 2001 From: Peng Xingchen <112612131+stellaxcpeng@users.noreply.github.com> Date: Tue, 14 Jul 2026 22:17:54 +0800 Subject: [PATCH] [NPU] Fix CPU device for node topology probe (#30619) --- python/sglang/srt/distributed/parallel_state.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/sglang/srt/distributed/parallel_state.py b/python/sglang/srt/distributed/parallel_state.py index d5ef2a767..42ab1b413 100644 --- a/python/sglang/srt/distributed/parallel_state.py +++ b/python/sglang/srt/distributed/parallel_state.py @@ -2633,7 +2633,9 @@ def in_the_same_node_as(pg: ProcessGroup, source_rank: int = 0) -> List[bool]: world_size = torch.distributed.get_world_size(group=pg) # 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" + ) # global ranks of the processes in the group ranks = torch.distributed.get_process_group_ranks(pg)