mne-tools / mne-tools/mne-python
FIX/ENH: permutation_t_test inefficient for many perumations and and big input matrices
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.5k
- Forks
- 1.6k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 100
Description
I suspect the reason is here:
https://github.com/mne-tools/mne-python/blob/master/mne/stats/permutations.py#L54
To give a simplified example:
If you have 50000 permutations, 5 jobs, and fsaverage source space data for a group of subject these dot products become heavy as via array split perms would be of size 10000, n_samples
Symptoms:
- computers die from memory and swapping limits
We should maybe change the parallelization and re-evaluate speed/memory tradeoffs.
Contributor guide
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.
Research direction
Begin with mne/stats/permutations.py at line 54 and trace how perms is split across jobs. Reproduce the 50,000-permutation, five-job, fsaverage source-space case described in the issue, then compare memory use and runtime while evaluating a different parallelization strategy. Done means avoiding swapping or computer failure without regressing permutation-test behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100