interplane.Get Omega
Read in your language

ggml

[Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685)

Brought by drakestapleton

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 <cstddef>
7
8// Opaque pipeline context -- owns all pinned buffers, streams, and events.
9struct 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.
14ggml_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.
18void 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.
25bool ggml_cuda_ar_allreduce(
26 ggml_cuda_ar_pipeline * pipeline,
27 ggml_backend_t * backends,
28 ggml_tensor ** tensors);
29