Conversation
…ate processes, implement it in the CUDA backend using NCCL, and use it in the RPC server when available.
|
Do you have any |
| // Same as above, but each rank is a separate process, so a process owns one backend of the | ||
| // communicator rather than all of them. | ||
| // One rank produces the unique id. Every other rank needs it, out of band, before calling | ||
| // comm_init_rank, which blocks until all ranks have joined. Free with ggml_backend_comm_free_t. | ||
| #define GGML_BACKEND_COMM_UNIQUE_ID_SIZE 128 | ||
| typedef bool (*ggml_backend_comm_get_unique_id_t)(void * id_out); | ||
| typedef void * (*ggml_backend_comm_init_rank_t)(ggml_backend_t backend, const void * id, int rank, int world_size); | ||
| typedef bool (*ggml_backend_comm_allreduce_rank_t)(void * comm_ctx, struct ggml_tensor * tensor); | ||
|
|
There was a problem hiding this comment.
Without having looked at any of the other code, changes to the ggml backend API like this should be avoided if at all possible.
There was a problem hiding this comment.
Added llama-bench results.
Removed ggml_backend_comm_allreduce_rank_t and now reuse ggml_backend_comm_allreduce_tensor for per-rank communicators.
@am17an , @JohannesGaessler, do you have any suggestions for handling ggml_backend_comm_get_unique_id_t and ggml_backend_comm_init_rank_t?
…llreduce_tensor for per-rank communicators
|
what's the reason why using NCCL is so much faster for PP vs TG? Maybe there is something to optimize in the generic path too |
@am17an, I tested three optimizations on the pairwise path:
Further improvement likely requires restructuring the collective into an overlapping pipeline of GPU transfers, network communication, and reduction. |
|
Ah okay nice these can be even added to the original PR I think. @ggerganov perhaps it may help in the metal speedup. Do you have a branch with these changes? |
|
errr I'm very confused, I've recently acquired a third 5060 Ti and started using tensor parallelism with NCCL enabled. Enabling NCCL doubled decode - I think prefill also increased significantly. I admit that I don't fully understand (or barely understand) the mechanics underneath - that's why the following question came to my mind when reading this PR: why does the PR say "Add nccl support for tensor parrallel" if that's something that apparently is already working? thanks |
|
This PR is for NCCL support over RDMA, not related to your setup. @zyang-dev perhaps change the title to reflect it better |
Overview
Add a backend interface for collectives across ranks running in separate processes, implement it in the CUDA backend using NCCL, and use it in the RPC server when available.
The implementation is on top of PR #26610.
Results on DGX spark:
single node:
Two nodes with NCCL:
Two nodes with pairwise:
Ratio to a single node:
Requirements