mlx icon indicating copy to clipboard operation
mlx copied to clipboard

[Feature Request] Complex Number and GPU Support for `mlx.linalg.svd` and `mlx.linalg.eig`

Open CadeXinyu opened this issue 1 month ago • 1 comments

Hi MLX Team,

Thank you for developing such an outstanding package! I’ve been using MLX recently and noticed that the function mlx.linalg.svd currently supports float32 and float64, while mlx.linalg.eig only supports float32.

Due to this limitation, I often need to switch to NumPy (numpy.linalg.eigh / numpy.linalg.svd) for eigenvalue computations, which noticeably reduces performance. Would it be possible to add complex number support in future updates?

I also found that both mlx.linalg.eig and mlx.linalg.svd currently run only on the CPU. Are there any plans to enable GPU acceleration for these functions?

Since SVD and eigenvalue decomposition share similar underlying algorithms and are essential for extracting principal features from data and performing dimension reduction—core steps in many mathematical, signal processing, and machine learning applications—GPU support would make these operations far more efficient and broadly useful.

Thank you again for your great work and continued improvements to MLX!

Best regards,
Cade

CadeXinyu avatar Oct 28 '25 01:10 CadeXinyu

A vote specifically for GPU support. Admittedly my use case of "old-fashioned statistical methods on the gpu" may be an unusual one.

hughjonesd avatar Nov 09 '25 20:11 hughjonesd

The complex part of this was closed in #2737

awni avatar Nov 22 '25 14:11 awni