Skip to content

update the tensor size of the test case based on the number of devices #1798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: daisyden/distributed_2.8
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions test/xpu/distributed/test_c10d_ops_xccl.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,12 @@ def allreduce(tensors, op):
def test_alltoall_ops_with_xpufree_race(self):
pg = self.pg
opts = c10d.AllToAllOptions()
num_devices = torch.xpu.device_count()
tensor_size = num_devices * 100
local_device = f"xpu:{self.rank_to_GPU[self.rank][0]}"
torch.xpu.set_device(local_device)
input = torch.rand(1000, 1000, device=local_device)
output = torch.rand(1000, 1000, device=local_device)
input = torch.rand(tensor_size, 1000, device=local_device)
output = torch.rand(tensor_size, 1000, device=local_device)
race_tensors = []
# create some tensors to race with alltoall collective
for _ in range(10):
Expand Down