cosanlab / cosanlab/nltools

GPU roadmap: matrix_permutation_test GPU path

Open
#486 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
130
Forks
48
Avg merge
6h 42m
Merged PRs (30d)
34

Description

From the [#484 scoping survey](https://github.com/cosanlab/nltools/issues/484#issuecomment-5432492136). `matrix_permutation_test` already fails loudly on `device='gpu'` (policy-compliant); this tracks the actual implementation.

Shape of the work: permutation = simultaneous row/column shuffling of the similarity matrix + a correlation per permutation — tractable as batched `torch.gather` (the same reindex-the-precomputed-matrix trick the 0.6.0 Kendall kernel uses in `correlation_permutation_test`) plus a batched correlation, sized through `auto_batch_size` with an `n²`-per-permutation working-set estimate and wrapped in `compute_oom_safe`.

Not a 0.6.0 blocker; 0.6.x roadmap.

Contributor guide

Open the contributing guide

Research direction

Start with the existing matrix_permutation_test GPU failure path and compare correlation_permutation_test, especially its 0.6.0 Kendall kernel and use of batched reindexing. Read auto_batch_size and compute_oom_safe to understand batching and OOM handling. Done means matrix_permutation_test executes on device='gpu' with batched permutation correlations, an n² working-set estimate, and OOM-safe computation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.