Tracking Issue: Support for CPython subinterpreters in NumPy
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 32.8k
- Forks
- 12.8k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 197
Description
Description:
This issue tracks the architectural changes required to support CPython subinterpreters, to safely support multiple interpreters running simultaneously, NumPy must stop relying on global shared memory and ensure every interpreter gets its own distinct module instance.
Initial Roadmap:
Following CPython's Isolating Extension Modules guide, we will start with:
- #29021 (This is an already on going effort by @AA-Turner)
- #31930
- Convert static types (
PyTypeObject) to dynamically allocated heap types (PyType_FromModuleAndSpec).
Expected Outcomes for this phase:
- Core modules can be safely imported multiple times across different subinterpreters without memory leaks or race conditions.
Other references: https://github.com/numpy/numpy/issues/24755
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 reading the CPython Isolating Extension Modules guide and the linked issues #29021 and #31930 to understand the planned work. Done means core modules can be imported multiple times across subinterpreters without memory leaks or race conditions, but this tracking issue does not identify a specific file or test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100