Fix annotate_muscle_zscore crash with n_jobs='cuda'#13994
Open
kveni12 wants to merge 3 commits into
Open
Conversation
Add n_jobs_hilbert so filtering can use CUDA while the Hilbert transform keeps integer-only parallelization.
|
Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴 |
larsoner
reviewed
Jun 29, 2026
Comment on lines
+124
to
+126
| raw_copy.apply_hilbert( | ||
| envelope=True, n_jobs=n_jobs_hilbert if n_jobs_hilbert is not None else 1 | ||
| ) |
Member
There was a problem hiding this comment.
Hmmm... this isn't backward compatible. Previously, if a user provided n_jobs=4 for example, this would use 4 jobs. So a better pattern I think is:
if n_jobs != "cuda" and n_jobs_hilbert is None:
n_jobs_hilbert = n_jobs
And you say in the docstring that n_jobs_hilbert will default to the value of n_jobs when n_jobs != "cuda".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #13993
Summary
n_jobs_hilbertparameter toannotate_muscle_zscoreso filtering and Hilbert transform can use separate parallelization settingsn_jobs='cuda'while Hilbert defaults ton_jobs=1whenn_jobs_hilbertis not setn_jobs='cuda', explicit integern_jobs/n_jobs_hilbert, and unchanged default behaviorTest plan
n_jobs='cuda',n_jobs=4/n_jobs_hilbert=2, default)mne/preprocessing/tests/test_artifact_detection.py::test_muscle_annotation_n_jobs_cudatest_muscle_annotationtests