Neuroinflab / kCSD-python

Kernel Current Source Density
https://kcsd-python.readthedocs.io/en/latest/
Other
15 stars 23 forks source link

numba jit speed increase #57

Open ccluri opened 5 years ago

ccluri commented 5 years ago

If we add numba as a requirement instead of skmonaco, we can then then deploy with just-in-time compiler https://numba.pydata.org/numba-doc/dev/user/5minguide.html Adding this line above all functions in basis_functions.py and before forward_method() and int_pot1d() / 2d() / 3d() in KCSD.py

@jit(nopython=True)

already improves the performance drastically, I am able to knock off ~7 secs from a 30 sec tests.

ccluri commented 5 years ago

@asiaszmek what do you think?

asiaszmek commented 5 years ago

I think it's a great idea. I'll start working on that once I am done with the build.

On Thu, Oct 25, 2018 at 03:29:26PM +0000, Chaitanya Chintaluri wrote:

@asiaszmek what do you think?

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/Neuroinflab/kCSD-python/issues/57#issuecomment-433096628

ccluri commented 5 years ago

Hah! This was your idea though! :) :+1: I was just playing with numba instead of cython

ccluri commented 5 years ago

An attempt on this lives on saved_tables branch https://github.com/Neuroinflab/kCSD-python/blob/7dc8bfea7fde168d55f2d3a9d0063b8aa31de102/kcsd/KCSD.py#L15 and in https://github.com/Neuroinflab/kCSD-python/blob/7dc8bfea7fde168d55f2d3a9d0063b8aa31de102/kcsd/basis_functions.py#L16

Do not merge with master, before #64 is addressed.

ccluri commented 5 years ago

Separating the co-dependence on #64 , an the PR #69 address this.