Skip to content
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

JIT compilation with numba #6

Open
oashour opened this issue May 6, 2024 · 0 comments
Open

JIT compilation with numba #6

oashour opened this issue May 6, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request performance Performance improvements

Comments

@oashour
Copy link
Collaborator

oashour commented May 6, 2024

My first thought was to use @jitclass, which I did for the numerics module in a4e2e21. However, this approach would be a long and painful road since every single class would have to be a @jitclass since they are all used in Calculator, and thus every single method in the entire package will have to be @njit compatible. This is simply not practical (nor desired, nor necessary).

The best option is a heavy refactoring of the code so that I'm computing the binned rate as a (n_velocities, n_masses, n_modes, n_bins) array, i.e., all the Single[...]Reach classes need to be heavily reworks so that I'm not looping over them and calculating the rate for each (v_e, m_chi) pair individually. Those classes should do all the setup, then the entire rate calculation can be taken outside the classes into an njitted method that does nothing but array operations.

@oashour oashour self-assigned this May 6, 2024
@oashour oashour added performance Performance improvements enhancement New feature or request labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance Performance improvements
Projects
None yet
Development

No branches or pull requests

1 participant