mlx
mlx copied to clipboard
Add float64 Eig and complex64 SVD/Eig support (Fixes #2708)
Proposed changes
Extended dtype support for mlx.linalg.svd and mlx.linalg.eig as requested in #2708.
Changes:
- Added
float64support formlx.linalg.eig(CPU) - Added
complex64support formlx.linalg.svd(CPU) - Added
complex64support formlx.linalg.eig(CPU)
Implementation details:
- Created LAPACK wrapper functions (
cgesdd_wrapper,cgeev_wrapper) to handle complex LAPACK signatures withrworkparameters - Added template specializations for
doubleandcomplex<float>ineig.cppandsvd.cpp - Extended unit tests in
test_linalg.pyto cover new dtypes
Limitations:
- GPU support not included (CPU only implementation)
complex128not supported (MLX doesn't define this dtype)
Checklist
Put an x in the boxes that apply.
- [x] I have read the CONTRIBUTING document
- [x] I have run
pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes - [x] I have added tests that prove my fix is effective or that my feature works
- [x] I have updated the necessary documentation (if needed)
Thanks for the review and feedback! I've refactored code and made the necessary changes. I request you to review them again.
Hi @awni, just checking in. I've addressed all the requested changes and pushed the updates. Whenever you get a moment, could you please review the latest commits? Thanks!
Yup, sorry for the delay.