Feature: [WIP] Enable NCCL library for GPU-Direct collective communications in plane wave (BPCG, stochastic KG, etc.)#7301
Open
Flying-dragon-boxing wants to merge 9 commits intodeepmodeling:developfrom
Conversation
Collaborator
Author
|
To-do:
|
Collaborator
Author
There was a problem hiding this comment.
Pull request overview
Adds an optional NCCL-backed implementation for GPU collective communications in Parallel_Common to improve stability vs CUDA-aware MPI on some platforms, and wires the build system to enable/link NCCL when requested.
Changes:
- Introduces NCCL implementations of
bcast,allreduce(sum), and anallgatherv-style operation for GPU buffers, with runtime dispatch inparallel_device. - Updates
PGemmCNto route reduction/gather steps through*_devcollectives (and adjusts temporary-buffer logic). - Adds CMake option + discovery/linking module to enable NCCL (
ENABLE_NCCL_PARALLEL_DEVICE).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| source/source_base/parallel_device.h | Adds NCCL collective declarations and dispatch in *_dev collectives; introduces get_buffer to avoid unnecessary D2H copies on non-root receive paths. |
| source/source_base/parallel_device.cpp | Implements NCCL communicator registry and NCCL-backed bcast/reduce/gatherv-style collectives. |
| source/source_base/para_gemm.cpp | Switches gather/reduce paths to reduce_dev/gatherv_dev and adjusts temp buffer allocation conditions. |
| cmake/SetupNccl.cmake | Adds NCCL find/link helper used by the top-level build. |
| CMakeLists.txt | Adds ENABLE_NCCL_PARALLEL_DEVICE option and integrates NCCL setup into CUDA builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| resmem_dev_op()(A_tmp_device_, max_colA * LDA); | ||
| #ifndef __CUDA_MPI | ||
| #if !defined(__CUDA_MPI) || defined(__NCCL_PARALLEL_DEVICE) |
| { | ||
| resmem_dev_op()(C_local_tmp_, size_C_local); | ||
| #ifndef __CUDA_MPI | ||
| #if !defined(__CUDA_MPI) || defined(__NCCL_PARALLEL_DEVICE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CUDA-Aware MPI seems to be unstable on different platforms (BW DCUs on Sugon SCNet, A800s on 北极星 HPC platform at PKU CLS and more). By enabling NCCL on these platforms, we can finally pass all CI tests on GPU with GPU-Direct collective communications enabled.
Still experimental.
Results on two A800s.


11_PW_GPU:
16_SDFT_GPU: