/torch-ucc

pytorch ucc plugin

Primary LanguageC++BSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Torch-UCC

The Torch-UCC plugin is a research prototype that enables collective communication over XCCL for distributed PyTorch applications that load the plugin at application runtime. The XCCL interface is a non-standard API with a corresponding reference implementation used to guide design decisions for the UCC project.

Licenses

The torch-ucc plugin is licensed as:

Contributor Agreement and Guidelines

In order to contribute to torch-ucc, please sign up with an appropriate Contributor Agreement. Follow these instructions when submitting contributions and changes.

Build

Required packages:

# Build
UCX_HOME=<PATH_TO_UCX> XCCL_HOME=<PATH_TO_XCCL> WITH_CUDA=<PATH_TO_CUDA> python setup.py clean --all install

UCX_HOME required, specifies path to UCX installation directory

XCCL_HOME required, specifies path to XCCL installation directory

WITH_CUDA optional, if WITH_CUDA=no is set then only CPU tensors are supported

Run

Configuration variables

Name Values Description
TORCH_UCC_THREAD_ENABLE 0 or 1 If not equal to zero then dedicated thread will be used to progress point to point and collective operations.
TORCH_UCC_TLS list of xccl team libraries Allows to choose what xccl team libraries will be used
export LD_LIBRARY_PATH=<PATH_TO_UCX>/lib:<PATH_TO_XCCL>/lib:$LD_LIBRARY_PATH
python example.py
import torch
import torch.distributed as dist
import torch_ucc

....
dist.init_process_group('ucc', rank=comm_rank, world_size=comm_size)
....
dist.all_to_all_single(recv_tensor, send_tensor)