# \donttest{
if (ggml_vulkan_available() && ggml_vulkan_device_count() >= 4) {
W <- matrix(rnorm(2048 * 64), nrow = 2048)
X <- matrix(rnorm(8 * 64), nrow = 8) # batch of 8
# 2 replicas x TP=2: batch split 4/4, weights split within {0,1} and {2,3}
Y <- ggml_tp_dp_forward(W, X, replicas = list(c(0, 1), c(2, 3)))
max(abs(Y - X %*% t(W)))
}
# }
Run the code above in your browser using DataLab