mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-08-06 10:00:48 -05:00
minor simplifications
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user