From 8ef4a845ed275955e52ced2982f61771c5e868cd Mon Sep 17 00:00:00 2001 From: Romain PEREIRA Date: Mon, 16 Mar 2026 10:44:27 -0500 Subject: [PATCH] Added documentation on experimental support for multi-gpu systems through XK.BLAS --- docs/make.jl | 1 + docs/src/multi-gpu.md | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 docs/src/multi-gpu.md diff --git a/docs/make.jl b/docs/make.jl index b7735b525..4da9cc7e7 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -27,6 +27,7 @@ makedocs( "Storage requirements" => "storage.md", "Preconditioners" => "preconditioners.md", "GPU support" => "gpu.md", + "Multi-GPU support" => "multi-gpu.md", "Warm-start" => "warm-start.md", "Matrix-free operators" => "matrix_free.md", "Callbacks" => "callbacks.md", diff --git a/docs/src/multi-gpu.md b/docs/src/multi-gpu.md new file mode 100644 index 000000000..f887d054c --- /dev/null +++ b/docs/src/multi-gpu.md @@ -0,0 +1,25 @@ +# [Multi-GPU support](@id multi-gpu) + +Krylov.jl has an experimental support for executing on multi-GPU systems through the [BLAS package of XK.jl](https://github.com/anlsys/xk.jl). +Multi-GPU interfaces are analogous to single-GPU's --- relying on Julia's types dispatcher on `XKVector` and `XKMatrix` to target multi-GPUs. +XK.jl handles work distribution and communications automatically and lazily. + +```julia +using Krylov, XK + +# CPU Arrays +A_cpu, y_cpu = symmetric_definite(n) + +# XK.jl Arrays +A_xk = XKMatrix(A_cpu) +y_xk = XKVector(y_cpu) + +# Run a conjugate gradient +(x_cpu, stats) = cg(A_xk, b_xk) + +# At this point of the execution, 'x' may be distributed across multiple memories. +# The next line triggers and wait for copies (e.g., D2H transfers) required so `x_cpu` holds a coherent replica on the host memory. +XK.memory_coherent_sync(x_cpu) +``` + +See [XK.jl repository](https://github.com/anlsys/XK.jl/tree/main/examples/Krylov) for examples.