-
Notifications
You must be signed in to change notification settings - Fork 11
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
[WIP] Numba accelerated alpha filtrations #23
base: master
Are you sure you want to change the base?
Conversation
Sweet! I'd love to see some numbers on how this improves the speed! I assume it's big time. |
Indeed there is a speedup, at least anecdotally. Sorry I don't have time right now to give you a comprehensive benchmark test, but here are some very quick numbers from my MacBook:
And this is without properly coding things up for maximum use of that sweet |
Update. The latest incarnation improves upon the version on 4D
This is a ~11.8x linear speedup. 3D
This is a ~7.5x linear speedup. 2D
This is a ~4x linear speedup. The extra performance comes mainly from the following changes:
One notable missing feature is any sort of treatment of numerical issues coming from lack of general position. This is still WIP with @ctralie. And correctness even in the presence of general position still needs to be checked more thoroughly! Another frontier is jitting not just the workhorse circumcircle functions but also the main algorithm. There is a technical issue here in that |
Codecov Report
@@ Coverage Diff @@
## master #23 +/- ##
===========================================
- Coverage 94.47% 76.34% -18.13%
===========================================
Files 12 12
Lines 398 427 +29
===========================================
- Hits 376 326 -50
- Misses 22 101 +79
Continue to review full report at Codecov.
|
I was finally able to njit everything! As an example of the latest figures, I can now run 10000 points in 4 dimensions in about 20 s (from the original 21 mins, i.e. a 60x speedup!). |
320121a
to
765f724
Compare
A ridiculously preliminary version of a
numba
-accelerated version ofalpha.py
. Thenumba
dependency has not yet been added to the installation requirements.There are two families of changes (besides some minor code cleanup):
numba
's stricter requirements on types. One of the effects of this is that some class methods have to become separate functions. Furthermore, the warnings in the circumcenter function currently breaknumba
compilation so I commented them out.else
clause in the for loop over thesigma
s. I also comment out some code which was unused, e.g. the variable assignment currently in line 198. And the commented out code in lines 112-127 are an alternative "global" version of the Gabriel condition check which I believe can shave off some further runtime due to fewer calls to the circumcenter function (as mentioned briefly to @ctralie).