-
Notifications
You must be signed in to change notification settings - Fork 104
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
Numba decorators #23
Comments
Done for Spread operator (forward and adjoint). Follow that structure for future operator optimization |
Is this still a goal for some of the other operators? |
Yes, as long as they show performance improvements over pure NumPy ones this is always welcome. @AhmedA1559, do you have something specific in mind? |
Yes. I was thinking of implementing Numba decorators for some of the dunder methods in the LinearOperator base class at first, if they yielded performance benefits with it. |
Sounds good. My reccomandation is that anything that simply calls NumPy/Scipy routines will likely not yield much benefit. In cases where writing a for...loop is the only way to go, then Numba may help. Please make sure to always compare pre and after Numba decoration as we will only accept to include changes where the performance gain is evident :) |
@mrava87 do we still need to add this? I would like to work on this if it is still relevant. |
Yes, still relevant. Read the comments above and do some digging of what methods you think may benefit from adding Numba decorators (which likely means you need to reimplement the matvec/rmatvec in a form that is Numba friendly more than Numpy friendly - eg with numpy you want to avoid |
Some of the main linear operators may get a speed-up by simply adding
numba <http://numba.pydata.org>
_@jit
decorators to_matvec
and_rmatvec
methods.Others, such as
FirstDerivative
may be suited to stencil decorator.Note: it may be enough to simply add
numba
to dependencies as it is a fairly common library but to keep dependencies to a minimum it may be better to implement private functions such as_matvec_serial
and_matvec_numba
and try importingnumba
, always falling back to by_matvec_serial
if that is not available in the python environment of the user.The text was updated successfully, but these errors were encountered: