ggml
[Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685)
Brought by drakestapleton
ggml / src / ggml-cuda / allreduce.cuh
| 1 | #pragma once |
| 2 | |
| 3 | #include "common.cuh" |
| 4 | #include "ggml-backend-impl.h" |
| 5 | |
| 6 | #include <cstddef> |
| 7 | |
| 8 | // Opaque pipeline context -- owns all pinned buffers, streams, and events. |
| 9 | struct ggml_cuda_ar_pipeline; |
| 10 | |
| 11 | // Allocate a pipeline for n_devices GPUs. |
| 12 | // devices[] holds the GPU device IDs in rank order. |
| 13 | // Returns nullptr on allocation failure. |
| 14 | ggml_cuda_ar_pipeline * ggml_cuda_ar_pipeline_init( |
| 15 | const int * devices, size_t n_devices); |
| 16 | |
| 17 | // Release all resources owned by the pipeline. |
| 18 | void ggml_cuda_ar_pipeline_free(ggml_cuda_ar_pipeline * pipeline); |
| 19 | |
| 20 | // Execute an in-place AllReduce (sum) across tensors[0..n_devices-1]. |
| 21 | // tensors[i] must live on the device managed by backends[i] and be |
| 22 | // contiguous F32, F16, or BF16. |
| 23 | // Preconditions are checked by the CUDA comm dispatcher before calling this. |
| 24 | // Returns true once the reduction work has been enqueued successfully. |
| 25 | bool ggml_cuda_ar_allreduce( |
| 26 | ggml_cuda_ar_pipeline * pipeline, |
| 27 | ggml_backend_t * backends, |
| 28 | ggml_tensor ** tensors); |
| 29 |