OpenMathLib / OpenMathLib/OpenBLAS
OpenBLAS bottlenecks multithreading benefits in `symv.c` interface at 8 working threads due to memory allocator lock conflict
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 7.6k
- Forks
- 1.7k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 42
Description
I have code that heavily makes use of the LAPACK syevr functions via Julia. They're relatively small matrices (at most 15x15). I'm processing chunks of video frames across multiple threads, and each thread will perform millions of these operations. I've set BLAS threads to 1, which I understand to mean that OpenBLAS just uses the parent thread calling it. (Setting it to anything more than 1 tanks performance generally.)
However, what I've found is that no matter what size computer I run on, performance gains stop once I reach 8 working threads; even worsening with many more. Somehow it seems that OpenBLAS, without itself doing multithreaded computation, is interfering with higher-level multithreading?
If I switch to MKL with 1 thread, I see continued performance improvements through 48 CPUs.
I'm willing to poke around at this as much as I can myself, I'm just not sure where to begin. Where might the bottleneck be?
Contributor guide
No contributing guide indexed for this repository
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 with the symv.c interface and reproduce the reported workload using LAPACK syevr on small matrices with BLAS limited to one thread. Compare scaling across working-thread counts with OpenBLAS and MKL, then identify whether an allocator lock or another OpenBLAS bottleneck explains the plateau at eight threads.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100