SpikeInterface / SpikeInterface/spikeinterface-dockerfiles

Kilosort 2 fails on extremely large "spike" trains

Open
#85 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dockerfile
Stars
9
Forks
8
PR merge metrics
No merged PRs in 30d

Description

KS2 throws an error when it finds a huge number of spikes:

        "Number of spikes before applying cutoff: 36449620",
        "----------------------------------------Error using gpuArray/eig",
        "EIG did not converge at index = 881672."

There is a very easy fix that doesn't appear in the docker and the docker is the only way to run KS2 on later versions of Ubuntu.

Would it be possible to add a container with a try and catch added to runTemplates.m in order to use the economy decomposition when huge spiketrains are found?

    try
        [A, B, C] = svdecon(UA);
    catch
        [A, B, C] = svd(UA,"econ");
    end

The economy-size decomposition removes extra rows or columns of zeros from the diagonal matrix of singular values, S, along with the columns in either U or V that multiply those zeros in the expression A = USV'. Removing these zeros and columns can improve execution time and reduce storage requirements without compromising the accuracy of the decomposition.
https://www.mathworks.com/help/matlab/ref/double.svd.html#d126e1780458

I added this issue to the KS2 repo but I don't have much hope of it being incorporated there now that they are focused on KS4+.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the v2.0.2 mainLoop/runTemplates.m entry point and the repository's existing Docker files. Verify how the container runs Kilosort 2 for large spike trains, then ensure the requested fallback to economy-size decomposition is included and the container can complete this case without the gpuArray/eig convergence error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, matlab
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.