Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/ggml/blob/master/src/ggml-cuda/allreduce.cuh # ggml [Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `ggml / src / ggml-cuda / allreduce.cuh` 29 lines ยท 1013 bytes Raw Blame History 1 #pragma once 2 3 #include "common.cuh" 4 #include "ggml-backend-impl.h" 5 6 #include 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