https://github.com/itamarst/openblas-tod
Experiment in threads-on-demand for OpenBLAS, to be moved elsewhere on success
https://github.com/itamarst/openblas-tod
Last synced: about 1 month ago
JSON representation
Experiment in threads-on-demand for OpenBLAS, to be moved elsewhere on success
- Host: GitHub
- URL: https://github.com/itamarst/openblas-tod
- Owner: itamarst
- Created: 2026-06-11T17:02:08.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-06-11T20:05:44.000Z (about 2 months ago)
- Last Synced: 2026-06-11T20:20:28.170Z (about 2 months ago)
- Language: Rust
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OpenBLAS-TOD: Replace the global OpenBLAS thread pool with threads on demand
The goal:
* When using OpenBLAS pthreads (e.g. `pip install numpy`), setting the number of threads in OpenBLAS sets it globally for a process-wide thread pool.
* When using OpenBLAS with OpenMP, setting the the number of threads is _thread-local_.
Imagine you set the number of OpenBLAS threads to 4, and you start a Python thread pool with 5 threads; each one starts an OpenBLAS computation.
Depending on which version of OpenBLAS you get, you might 4 threads running OpenBLAS code (mixing work from 5 Python thread), or a total of 4×5 == 20 threads running OpenBLAS code.
This inconsistency is a problem!
This project (currently a proof of concept) installs new logic into OpenBLAS on pthreads, so that it starts a thread pool for each parallel operation, more like OpenMP.
(Unlike OpenMP there is still only one single process-wide setting for number of OpenBLAS threads.)