Creating a sparse analyzer with multiprocessing crashes if sorting has a lot of units
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- python
- Domain
- data, distributed-systems
Research direction
Start at the create_sorting_analyzer entry point and reproduce the failure with the provided recording, sorting, sparse=True, and varying n_jobs and unit counts. Compare in-memory, binary-folder, and zarr analyzers, then inspect estimate_sparsity and multiprocessing resource handling. Done means large sparse analyzers complete without a leaked shared-memory warning or a stuck kernel.
Written by the indexing model from the issue text.
Description
When creating a new analyzer from a sorting object with a few hundred units, it can crash if n_jobs is set to use more than one core.
From a recording with ~1500 units :
import spikeinterface.full as si
from pathlib import Path
path = r'/path/to/folder/sc2_output'
recording = si.load(Path(path).joinpath('spikeinterface_recording.json'))
sorting = si.load(Path(path).joinpath('sorter_output/sorting'))
analyzer = si.create_sorting_analyzer(recording=recording,
sorting=sorting,
sparse=True,
format='memory',
n_jobs=0.25,
)
Results in the following :
/home/user/.conda/envs/spike/lib/python3.12/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d '
Or a stuck kernel in a notebook.
This seems to be dependant on both the number of cores and the number of units. By selecting n units with :
sorting = sorting.select_units(sorting.unit_ids[0:n])
I can see the limit is about 800 units with n_jobs=0.25, which on my machine is 10 cores.
If I lower n_jobs to 0.15, which is 6 cores, I can go up to 1000 units, and 4 cores can handle the full sorting.
This is the case when creating both in-memory and on-disk analyzers (binary folder and zarr). I've monitored ressources during the process and it does not look like an OOM error.
This can get pretty constraining specifically because of estimate_sparsity, which can take a while on long recordings with no parallel processing. Afterwards, computing extensions on the full recording with 10 cores doesn't cause any problem.
- Dominant language
- Python
- Stars
- 855
- Forks
- 280
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 38
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SpikeInterface/spikeinterface
-
testing
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
SpikeInterface/spikeinterface#4756 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SpikeInterface/spikeinterface#4510 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
SpikeInterface/spikeinterface#4824 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 32/100
SpikeInterface/spikeinterface#4816 ·
Maintainers usually reply within 1 day
-
GatherToNpy/Zarr could pre-allocate stores when number of spike is knownPossibly taken @samuelgarcia claimed this 6 days ago. Openperformance
Difficulty 4/5 3-5 days Newbie friendliness 55/100
SpikeInterface/spikeinterface#4787 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
All issues in SpikeInterface/spikeinterface
Similar issues
-
Zero-token evaluations are treated as missing cost in selectionPossibly taken @sylvesterkaczmarek claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
google-research/rrsi#6 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
aws-samples/sample-aws-genai-db-modernizer#294 ·
Maintainers usually reply within 1 day
-
feedback simulation workshop
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
githubnext/gh-aw-workshop#4174 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
WingedGuardian/GENesis-AGI#2852 ·
Maintainers usually reply within 1 day
-
camlight produces degenerate target camera and light framesPossibly taken @kavyabhand claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
google-deepmind/mujoco_warp#1743 ·
Maintainers usually reply within 1 day