ENH: Speed up complex-real matrix multiplication
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 32.8k
- Forks
- 12.8k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 197
Description
Proposed new feature or change:
Given a complex-valued matrix C of size MxN and a real-valued one R of size NxQ it should be possible to perform the C @ R operation between the two matrices using one strided GEMM call, exploiting the contiguous nature of the real and imaginary parts.
I suppose MATLAB is performing something similar as I've noticed a 2x difference in execution time between C * R and (R' * C')'.
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
Start by locating NumPy's matrix-multiplication implementation and its GEMM dispatch for complex-by-real operands. Confirm how the contiguous real and imaginary parts are represented, then benchmark C @ R against the transposed workaround. Done means the operation uses one strided GEMM call while preserving numerical results and improving the reported performance gap.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100