pykilosort icon indicating copy to clipboard operation
pykilosort copied to clipboard

implement spikeinterface wrapper

Open samuelgarcia opened this issue 4 years ago • 5 comments

See https://github.com/SpikeInterface/spikesorters/issues/177

samuelgarcia avatar Sep 15 '20 13:09 samuelgarcia

Hi @samuelgarcia. It'd be cool to do this. We are going to add a few more features / releases over the next month or so then might be in a good state to make this happen.

alexmorley avatar Nov 02 '20 17:11 alexmorley

OK tell us when there is a releasde on pypi. Will you add some CLI or is it a pure python interface ? The old wrapper was done with generating a ".m" file.

samuelgarcia avatar Nov 02 '20 17:11 samuelgarcia

Will do.

Pure python to start with. NB: there is no CPU-only support right now (like the matlab 2.0 version requires a GPU).

alexmorley avatar Nov 03 '20 14:11 alexmorley

I can guess so if you use cupy.

samuelgarcia avatar Nov 03 '20 14:11 samuelgarcia

I started a wrapper in spikeinterface here https://github.com/SpikeInterface/spikeinterface/pull/95 Note that this wrapper is part of a "big refactoring". So it is experimental.

The wrapper is simple but I am not yet able to run pyks because of installation problems dur to cuda. Stuff like that

  File "/home/samuel.garcia/Documents/SpikeInterface/spikeinterface/spikeinterface/sorters/pykilosort/pykilosort.py", line 95, in _run_from_folder
    run(
  File "/home/samuel.garcia/.virtualenvs/py38/lib/python3.8/site-packages/pykilosort-2.0.0a0-py3.8.egg/pykilosort/main.py", line 165, in run
    out = clusterSingleBatches(ctx)
  File "/home/samuel.garcia/.virtualenvs/py38/lib/python3.8/site-packages/pykilosort-2.0.0a0-py3.8.egg/pykilosort/cluster.py", line 450, in clusterSingleBatches
    wPCA = extractPCfromSnippets(proc, probe=probe, params=params, Nbatch=Nbatch)
  File "/home/samuel.garcia/.virtualenvs/py38/lib/python3.8/site-packages/pykilosort-2.0.0a0-py3.8.egg/pykilosort/cluster.py", line 143, in extractPCfromSnippets
    U, Sv, V = svdecon(CC)
  File "/home/samuel.garcia/.virtualenvs/py38/lib/python3.8/site-packages/pykilosort-2.0.0a0-py3.8.egg/pykilosort/cptools.py", line 302, in svdecon
    D, U = cp.linalg.eigh(C, 'U')
  File "/home/samuel.garcia/.virtualenvs/py38/lib/python3.8/site-packages/cupy/linalg/eigenvalue.py", line 133, in eigh
    return _syevd(a, UPLO, True)
  File "/home/samuel.garcia/.virtualenvs/py38/lib/python3.8/site-packages/cupy/linalg/eigenvalue.py", line 82, in _syevd
    syevd(
  File "cupy_backends/cuda/libs/cusolver.pyx", line 2068, in cupy_backends.cuda.libs.cusolver.ssyevd
  File "cupy_backends/cuda/libs/cusolver.pyx", line 2077, in cupy_backends.cuda.libs.cusolver.ssyevd
  File "cupy_backends/cuda/libs/cusolver.pyx", line 700, in cupy_backends.cuda.libs.cusolver.check_status
cupy_backends.cuda.libs.cusolver.CUSOLVERError: CUSOLVER_STATUS_INTERNAL_ERROR

One question : how is supposed to be the output ?

samuelgarcia avatar Mar 23 '21 20:03 samuelgarcia