-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CPU LU factorization and linear solvers #1451
base: main
Are you sure you want to change the base?
Conversation
This looks good to me. I'm debating with myself if we should try to do this in high-level ops rather than add a new primitive for it. On the one-hand it is definitely going to be way less efficient. On the other hand it will run on the GPU and have transform support out of the box. I'm also ok landing this and rearranging the back-end at a later time if ti makes sense. |
Were you thinking of an approach using |
I think exactly that would be better and more flexible than what we have now. I was even wondering if we could do |
Ok, working on adding a |
Added Also added two linear solvers, This pr closes #30 |
This will be really useful, thank you. |
Proposed changes
Adds
mx.linalg.solve
backend following the numpy implementation.For the LAPACK routines, I chose to use a combination of
sgetrf
andsgetrs
, which is equivalent to callingsgesv
(https://stackoverflow.com/a/36065619) because it removes a transpose ofa
in the C++.Checklist
Put an
x
in the boxes that apply.pre-commit run --all-files
to format my code / installed pre-commit prior to committing changes