"...git@developer.sourcefind.cn:2222/OpenDAS/vllm_cscc.git" did not exist on "466e878f2ad5e36cba4861db1cac7cd0d92055fb"
Commit 912dc4c9 authored by xiabo's avatar xiabo
Browse files

解决custom allreduce在dp情况下的其服务错误问题

parent 16732666
...@@ -121,7 +121,11 @@ class CustomAllreduce: ...@@ -121,7 +121,11 @@ class CustomAllreduce:
else: else:
device_ids = list(range(cuda_device_count_stateless())) device_ids = list(range(cuda_device_count_stateless()))
physical_device_id = device_ids[device.index] if (world_size == len(device_ids)):
physical_device_id = device_ids[device.index % world_size]
else:
physical_device_id = device_ids[device.index]
tensor = torch.tensor([physical_device_id], tensor = torch.tensor([physical_device_id],
dtype=torch.int, dtype=torch.int,
device="cpu") device="cpu")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment