-
-
Notifications
You must be signed in to change notification settings - Fork 9
Feat: Adding Linear Algebra Dot operation support #116
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
Conversation
Ahh forgot to update the general CI, or should we remove the |
Would the new functionality only be accessed through the dot function or is there a way to call that automatically when using numpy dot, matmul, etc? |
Unfortunately no, not easily. We'd need to add a new dtype hook to the DType API in NumPy. Worth doing though! See numpy/numpy#28516 which adds a hook for sorting. |
As per @seberg 's suggestion, this now implements Some extra stuff includes:
@ngoldbaum please take a look and let me know if anything needs a fix |
This is a lot of code! I'll try to give this a once-over but I'm probably not going to have the bandwidth to go over this with a fine-toothed comb. @juntyr I'd appreciate it if you could also do a round of code review. Don't be afraid to ask questions if anything is confusing to you. |
Yeah the refactor of umath made it big (but those codes are already reviewed), here is what's new
|
return NULL; | ||
} | ||
|
||
QuadBLAS::set_num_threads(num_threads); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also maybe check for a setting from threadpoolctl
: https://github.com/joblib/threadpoolctl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, yes so by default (during the importing of package) it uses all the available cores but I also expose a python function which directly allow users to change this to whatever they want at any time.
I can add the functionality to just pick similar to numpy using threadpoolctl
Thanks @ngoldbaum will apply all the changes in next commit :) and so sorry this one got hectic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one minor comment - go ahead and self-merge!
I didn't test the windows instructions but we can always fix issues later and I think what's in here is a significant improvement over the nothing we had before :)
I wrote these parallel to windows CI and tested them on windows-11 PC |
This PR contributes as follows:
dot
method within package that supports following operationsImages below are the performance comparison
To compile without QBLAS set
DISABLE_QUADBLAS
asCFLAGS
andCXXFLAGS