How to build pytorch with NCCL 2.7.6

I’m trying build pytorch from source and need to make use of NCCL 2.7.6 or higher. The current pytorch is built using 2.7.3. Is there a way to do this?

Thank you

You can potentially clone your own pytorch repo and upgrade nccl in there only, after that you can recompile from source. Would that work?

I did clone the pytorch repo and build from it. Can you point me where to make that update?
I did check cmake/modules/FindNCCL.make.

Hey @Purvak-L, you can cd to the NCCL submodule in the third party folder in and manually update the nccl module there.

Another option is to install 2.7.6 locally and set USE_SYSTEM_NCCL=1 when building PyTorch. See this issue:

1 Like

Thank you @mrshenli

This helped! I downloaded the latest NCCL ( and set the flag. After that I built pytorch from source using python install

1 Like