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

Removing numexpr and refactoring related code with Numba #251

Closed
AhmetCanSolak opened this issue Oct 5, 2022 · 2 comments
Closed

Removing numexpr and refactoring related code with Numba #251

AhmetCanSolak opened this issue Oct 5, 2022 · 2 comments
Assignees

Comments

@AhmetCanSolak
Copy link
Collaborator

Out of curiosity, I benchmarked our normalisation code(which currently uses numexpr) against vanilla numpy implementation and Numba CPU implementation. Here are the results:

Array size 2560:
numba CPU 7.586696507001761
numexpr 246.33255801402265
numpy 191.35872586001642

Array size 256:
numba CPU 5.624689556017984
numexpr 32.61893176403828
numpy 24.161521231988445

Given these results, I like to suggest a refactor where we replace numexpr code with numba code. Refactor PR will include a more complete benchmark result as well.

@AhmetCanSolak AhmetCanSolak self-assigned this Oct 5, 2022
@AhmetCanSolak AhmetCanSolak changed the title Removin numexpr and refactoring related code with Numba Removing numexpr and refactoring related code with Numba Oct 5, 2022
@AhmetCanSolak
Copy link
Collaborator Author

AhmetCanSolak commented Oct 5, 2022

Further benchmarks confirm this is a good refactor idea:

Array size 64
numba CPU 4.326524862030055
numexpr 16.155105154961348
numpy 9.394594879006036
Array size 512
numba CPU 4.570238107990008
numexpr 50.40331728797173
numpy 42.531917844957206
Array size 4096
numba CPU 4.205319889006205
numexpr 368.57043074804824
numpy 304.04271511000115
Array size 50000
numba CPU 3.8292692149989307
numexpr 3835.7974430529866
numpy 3612.0402962410008
Array size 100000
numba CPU 3.682938974001445
numexpr 7509.473760196008
numpy 7345.76169827499



Array size 64 64
numba CPU 19.90459941298468
numexpr 73.22979042399675
numpy 33.02817464299733
Array size 512 512
numba CPU 33.39659032301279
numexpr 1592.8726531530265
numpy 1431.3514493999537

@AhmetCanSolak
Copy link
Collaborator Author

#252 closes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant