Fix CuPy batched solve shape mismatch in _estimate_transfer_function#76
Merged
edeno merged 2 commits intoMay 12, 2026
Merged
Conversation
Collaborator
|
I checked this and it looks reasonable to me. I'm fairly certain that all of the annoying assert changes are just formatting. Want @edeno to doublecheck the CuPy main edits. |
Broadcast the identity RHS to match H's batch dimensions before calling xp.linalg.solve in connectivity routines (regularized inverse path). This prevents CuPy batched-solve shape mismatch crashes (affecting DTF/PDC/GPDC/DDTF on GPU). Also: add test test_regularized_solve_rhs_matches_batched_lhs to assert RHS/LHS shapes match, update reshaping tuple style, apply minor test assertion formatting cleanups, and expand the CHANGELOG entry to describe the fix.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #76 +/- ##
==========================================
- Coverage 88.65% 88.35% -0.30%
==========================================
Files 8 8
Lines 1789 1786 -3
==========================================
- Hits 1586 1578 -8
- Misses 203 208 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
Hi @tomHep10, Thank you for catching this and for your contribution. I hope you don't mind, but I reverted some changes the |
Contributor
Author
|
@edeno Not at all! Thank you, glad this helped. |
edeno
added a commit
that referenced
this pull request
May 12, 2026
Patch release fixing CuPy batched-solve shape mismatch in transfer function and MVAR Fourier coefficient computation (PR #76).
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 CuPy GPU crash in
_estimate_transfer_functionwhere a non-batched identity matrix(M, M)was passed toxp.linalg.solvewith a batchedaof shape(..., 1, M, M).Fix: broadcast identity to match
H_0.shapebefore solving.Confirmed working on NVIDIA B200 GPU with LFP dataset.