| ggml_vulkan_split_buffer_type | R Documentation |
Builds (or fetches from a cache) a ggml buffer type that row-splits a
weight tensor across n_devices GPUs for tensor parallelism. This is the
factory the graph allocator talks to (Stage E4): a weight placed in this buffer
type has its rows distributed across the devices, each holding a contiguous
band (see ggml_vulkan_split_row_ranges). Non-split tensors fall
back to main_device.
ggml_vulkan_split_buffer_type(
n_devices = ggml_vulkan_device_count(),
main_device = 0L,
weights = NULL,
device_ids = NULL,
transport = c("host-staging", "opaque-fd", "device-group"),
probe = NULL
)
n_devices |
Number of GPUs to split across (default: all available).
Ignored if |
main_device |
Device index (0-based) holding non-split fallbacks (default 0). |
weights |
Optional numeric vector of length |
device_ids |
Optional integer vector of physical GPU indices (0-based) the
split slots map onto, e.g. |
transport |
Cross-device gather transport for the eventual compute:
|
probe |
A numeric vector |
The buffer type is cached in C and lives for the rest of the session; the returned external pointer has no finalizer and must not be freed.
A named list: ptr (external pointer to the cached buffer type),
name (its config-derived name) and alloc_size (sum of the
padded per-device slice sizes for probe, in bytes; 0 if no probe).
if (ggml_vulkan_available() && ggml_vulkan_device_count() >= 2) {
bt <- ggml_vulkan_split_buffer_type(n_devices = 2, probe = c(2048, 64))
bt$name
bt$alloc_size # total bytes for a 2048x64 f32 weight across 2 devices
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.