From 1e502e247e19fabfc46aca6fdd5ca0e64759aa6f Mon Sep 17 00:00:00 2001 From: "Deng, Weishi" Date: Wed, 7 May 2025 22:53:37 -0700 Subject: [PATCH] add xccl backend init --- torchbenchmark/models/moco/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/torchbenchmark/models/moco/__init__.py b/torchbenchmark/models/moco/__init__.py index b70605c30f..4287a3239a 100644 --- a/torchbenchmark/models/moco/__init__.py +++ b/torchbenchmark/models/moco/__init__.py @@ -70,6 +70,16 @@ def __init__(self, test, device, batch_size=None, extra_args=[]): ) except RuntimeError: pass # already initialized? + elif device == "xpu": + try: + dist.init_process_group( + backend="xccl", + init_method="tcp://localhost:10001", + world_size=1, + rank=0, + ) + except RuntimeError: + pass # already initialized? elif device == "xla": import torch_xla.distributed.xla_backend