Tracking Issue: Support for CPython subinterpreters in NumPy

Open
#32,451 0 comments 3 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
c, python
Domain
backend

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.

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
  • #32747

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

Dominant language
Python
Stars
33.5k
Forks
13.1k
Avg merge
1d 19h
Merged PRs (30d)
143

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from numpy/numpy

All issues in numpy/numpy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.