minor simplifications

This commit is contained in:
Scott Cutler
2026-04-24 14:38:06 -07:00
parent 485ee23289
commit 892b2e388d
3 changed files with 4 additions and 9 deletions

View File

@@ -520,7 +520,6 @@ bool ggml_cuda_ar_allreduce(
}
const size_t max_chunk_elems = p->buf_bytes / type_size;
GGML_ASSERT(max_chunk_elems > 0);
// Insert chunked kernels into each GPU's existing compute stream via events:
// record(app, compute_stream) — capture "upstream done"

View File

@@ -14,8 +14,9 @@ struct ggml_cuda_ar_pipeline;
// Allocate a pipeline for n_devices GPUs.
// devices[] holds the CUDA device IDs in rank order.
// max_bytes is the staging buffer size per device; must be at least as large
// as the largest tensor that will be reduced.
// max_bytes is the staging buffer size per device, which also bounds the
// per-launch chunk size; tensors larger than this are reduced via multiple
// chunked launches.
// Returns nullptr on allocation failure.
ggml_cuda_ar_pipeline * ggml_cuda_ar_pipeline_init(
const int * devices, size_t n_devices, size_t max_bytes);

View File

@@ -1327,11 +1327,6 @@ static bool ggml_backend_cuda_comm_allreduce_nccl(
}
#endif // GGML_USE_NCCL
static bool ggml_backend_cuda_comm_allreduce_internal(
ggml_backend_cuda_comm_context * comm_ctx, struct ggml_tensor ** tensors) {
return ggml_cuda_ar_allreduce(comm_ctx->ar_pipeline, comm_ctx->backends.data(), tensors);
}
enum ggml_cuda_comm_allreduce_result {
GGML_CUDA_COMM_ALLREDUCE_SUCCESS,
GGML_CUDA_COMM_ALLREDUCE_UNSUPPORTED,
@@ -1389,7 +1384,7 @@ static ggml_cuda_comm_allreduce_result ggml_backend_cuda_comm_try_allreduce_inte
}
}
return ggml_backend_cuda_comm_allreduce_internal(comm_ctx, tensors)
return ggml_cuda_ar_allreduce(comm_ctx->ar_pipeline, comm_ctx->backends.data(), tensors)
? GGML_CUDA_COMM_ALLREDUCE_SUCCESS
: GGML_CUDA_COMM_ALLREDUCE_FAILED;
}