Skip to content
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
8 changes: 7 additions & 1 deletion test/distributed/test_functional_differentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
devices += [acc.type]


def compile_backend_for_device(device):
device_type = torch.device(device).type
registered = torch.compiler.list_backends()
return device_type if device_type in registered else "inductor"


def with_comms(func=None):
if func is None:
return partial(with_comms)
Expand Down Expand Up @@ -900,7 +906,7 @@ def test_all_to_all_single_autograd_compile(self):
output_split_sizes = [input_tensor.shape[0] // group_size] * group_size
input_split_sizes = output_split_sizes

@torch.compile(fullgraph=True)
@torch.compile(backend=compile_backend_for_device(self.device), fullgraph=True)
def compiled_fn(tensor):
output = torch.ops._c10d_functional_autograd.all_to_all_single(
tensor,
Expand Down