-
Notifications
You must be signed in to change notification settings - Fork 33
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
speed-up trials with numba #67
Comments
@pawel21 sometimes ago I sent you an invitation to become a collaborator of the project. It is still pending, can you search in your mailbox and accept it. If you accept it you'll have more edit privileges and I can assign you issues 😄 |
Sorry, I missed it. Could you send me again? (because where I tried accept I got error: "This invitation has expired. ") |
Hi, I modified code to speed-up fit with |
Thanks a lot @pawel21, I checked it. |
Hi, I added two scripts to profile the code with |
Thanks @pawel21 and sorry for having ignored you. I had a similar improvement in execution times with numba, I remember something like half of it. Now, concerning your tests I see two problems:
Thanks again and let me know how you want to proceed. |
Hi @pawel21 @cosimoNigro Another thing that I was thinking about is cache-ing the function values, there is a decorator for this as well. I'm not sure if this will help here, because we do not have any single parameter functions that is executed multiple times for the same values, but if it is easy we can try it with cos_psi_jit which has 3 angle parameters, but it is executed multiple times for different nus and gammas. The third thing, compton_kernel_jit is using a number of small one-line functions, get_y, get_y_1, get_y_2, get_values that I do not think are used anywhere else. I guess there should be some overhead in Python from executing a function (especially if we use extra decorators) and those are executed all the time, so I would naively assume that moving those lines inside the main compton_kernel_jit function would speed some somewhat the code (and make it shorter as well. |
As we discussed in last week's call @pawel21 will take care of trying to speed-up the SED computations using
numba
.I suggested him to copy, in a script or in a notebook, one of the
evaluate_sed_flux
(e.g. the synchrotron one which is the simplest) and try to decorate it with numba.After my latest modifications (PR #52) functions are
@classmethod
s, so you do not need any otheragnpy
class (like the blob) to run them. They take directly as input all the physical parameters necessary to compute the SED (before some of them where provided by the blob - like spectral parameters and magnetic field).The text was updated successfully, but these errors were encountered: