feat: Add SVD primitive GPU evaluation support

- Implement SVD::eval_gpu in Metal primitives backend
- Add proper float32/float64 type dispatch
- Include clear error messages for unsupported double precision
- Connect SVD primitive to Metal backend implementation
- Enable GPU path for SVD operations in MLX
This commit is contained in:
Arkar Min Aung 2025-06-14 21:23:04 +10:00
parent 54125e5ff5
commit f4789ab8b9

View File

@ -348,7 +348,10 @@ void SVD::eval_gpu(
svd_metal_impl<float>(inputs[0], outputs, compute_uv_, d, s);
break;
case float64:
svd_metal_impl<double>(inputs[0], outputs, compute_uv_, d, s);
// Metal does not support double precision, fall back to CPU
throw std::runtime_error(
"[SVD::eval_gpu] Double precision not supported on Metal GPU. "
"Use mx.set_default_device(mx.cpu) for float64 SVD operations.");
break;
default:
throw std::runtime_error(