| ggml_vulkan_split_row_ranges | R Documentation |
Pure arithmetic helper for the Vulkan tensor-parallel split buffer type: given
a number of tensor rows and a per-device weight vector, returns the half-open
row range [row_low, row_high) owned by each device. Row boundaries are
rounded down to a fixed granularity, and the last device always covers up to
nrows, so the ranges are contiguous, non-overlapping and cover every
row exactly once.
ggml_vulkan_split_row_ranges(nrows, n_devices, weights = NULL)
nrows |
Number of rows in the tensor (integer). |
n_devices |
Number of devices to split across (integer, >= 1). |
weights |
Optional numeric vector of length |
This touches no GPU and is exposed mainly to verify the split logic. It is the math behind row-split tensor parallelism (a weight matrix distributed across several GPUs), independent of any actual multi-GPU allocation.
A named list with row_low and row_high: numeric vectors
of length n_devices holding 0-based, half-open row ranges.
if (ggml_vulkan_available()) {
# 4096 rows across 2 devices, evenly
ggml_vulkan_split_row_ranges(4096L, 2L)
# weighted 3:1
ggml_vulkan_split_row_ranges(4096L, 2L, weights = c(3, 1))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.