Skip to content
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

Use NCCL and toggle libuv for compatibility with latest pytorch versions #947

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

deiteris
Copy link
Contributor

@deiteris deiteris commented Jan 11, 2025

Description

This changes the backend from GLOO to NCCL for macOS and Linux targets using CUDA and keeping GLOO for Windows using any GPU since NCCL is not compiled for it. This also conditionally disables the use of libuv for Windows since pytorch >2.4 is compiled without libuv.
https://pytorch.org/tutorials/intermediate/TCPStore_libuv_backend.html#impact

This does not break compatibility with ROCm since ROCm pytorch uses RCCL under the hood:
https://discuss.pytorch.org/t/ddp-with-amd-rocm/118928/2

Motivation and Context

This allows for the usage of latest PyTorch versions and keeping distributed training on Windows while using NCCL on other OS to improve multi-gpu CUDA performance on Linux runners.

How has this been tested?

Run the code with Nvidia GPU on Windows and Linux. The code runs with PyTorch >2.4 on Windows, previously failed to run due to libuv error.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Contributor

@AznamirWoW AznamirWoW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works on Windows single GPU, need someone to check on multi and Kaggle/colab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants