From f2c731c29b42dfd5eb5269a099c718bda438be84 Mon Sep 17 00:00:00 2001 From: Arkar Min Aung Date: Sat, 14 Jun 2025 21:23:18 +1000 Subject: [PATCH] feat: Enable GPU support in linalg SVD interface - Remove CPU-only restriction from linalg::svd function - Allow SVD operations to run on GPU devices - Add documentation noting Metal GPU acceleration support for float32 - Maintain backward compatibility with existing CPU usage - Enable users to explicitly request GPU execution for SVD --- mlx/linalg.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mlx/linalg.cpp b/mlx/linalg.cpp index 144f9a880..66e39275f 100644 --- a/mlx/linalg.cpp +++ b/mlx/linalg.cpp @@ -249,7 +249,8 @@ std::pair qr(const array& a, StreamOrDevice s /* = {} */) { std::vector svd(const array& a, bool compute_uv, StreamOrDevice s /* = {} */) { - check_cpu_stream(s, "[linalg::svd]"); + // Note: SVD now supports Metal GPU acceleration for float32 + // check_cpu_stream(s, "[linalg::svd]"); // Removed to enable GPU support check_float(a.dtype(), "[linalg::svd]"); if (a.ndim() < 2) {