| ggml_matmul_f64 | R Documentation |
Computes A %*% B on the Vulkan GPU in full double precision
(fp64), returning an ordinary R matrix, with a transparent CPU fallback.
Unlike ggml_matmul (which is f32/f16 and approximate), this
matches R's %*% to machine precision (~1e-15), because the
kernel accumulates in double throughout.
ggml_matmul_f64(A, B, device = "auto")
A, B |
Numeric matrices with |
device |
|
fp64 on the GPU is only worthwhile on hardware with fast double throughput:
data-centre cards (NVIDIA Tesla P100/V100, AMD Instinct) run fp64 at 1:2 of
fp32, whereas consumer GPUs cripple it (RDNA ~1:16, GeForce ~1:64), where the
CPU (multithreaded double BLAS) is usually faster. Use this when you need
bit-accurate double results on a capable GPU, or for numerically sensitive
work where the f32 path's error is unacceptable; otherwise prefer
ggml_matmul. Requires the shaderFloat64 device feature — without
it (or without a GPU), the multiply silently falls back to the CPU.
The product A %*% B as a numeric matrix, accurate to
double precision.
ggml_matmul (faster f32/f16 approximate path).
A <- matrix(rnorm(4), 2); B <- matrix(rnorm(4), 2)
ggml_matmul_f64(A, B, device = "cpu")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.