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

Kilosort takes extremely long to sort 4-shank Neuropixel recording #631

Closed
guidomeijer opened this issue Mar 25, 2024 · 2 comments
Closed

Comments

@guidomeijer
Copy link

Hi there, I recently switched to KS4 and got good results sorting a NP1 recording. However, when trying on a NP2 4-shank recording it takes an extreme amount of time. The sorting runs in 8 hours but the step that comes after (recalculating spike templates) would take an estimated 160 hours. And this is for only one of the four shanks. The only thing I noticed is that the allocated GPU memory was a bit low (700 MB), this was much higher when sorting the NP1 recording. I have a local installation of Kilosort which is launched by SpikeInterface and run using the run_sorter_by_property function to run the sorting per shank. I use all the default settings of Kilosort.

Setup:
NVIDIA RTX 4080
64 GB RAM
Ubuntu 20.04
kilosort 4.0.2
spikeinterface 0.100.2

Any ideas would be appreciated!

@jacobpennington
Copy link
Collaborator

Hello,

For multi-shank probes, we've been recommending that people artificially stack contacts vertically in the probe layout, treating them as a single shank with a ~100 micron gap between shanks. This will remove the need to sort shanks one at a time. Others have encountered long sorting times before doing this (as well as some related errors), and this temporary workaround fixed the issue. We'll be updating the code in the near future to explicitly handle separate shanks so that this won't be necessary.

As for why it would be running for so long when sorting a single shank, I don't know. It may have something to do with how SpikeInterface is running the sorter, but that would be a question for their team. I would recommend you try running Kilosort directly (with the change suggested above), instead of through SpikeInterface, if you continue to have issues.

@guidomeijer
Copy link
Author

Hi Jacob, thanks for your reply. Your suggestion works great, it runs in a couple of hours now!

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

No branches or pull requests

2 participants