Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEP684 Subinterpreter support #8394

Open
sklam opened this issue Aug 24, 2022 · 0 comments
Open

PEP684 Subinterpreter support #8394

sklam opened this issue Aug 24, 2022 · 0 comments
Labels
discussion An issue requiring discussion feature_request

Comments

@sklam
Copy link
Member

sklam commented Aug 24, 2022

Feature request

PEP684 will allow subinterpreters to be properly isolated (separate module state, separate GIL) in Python 3.11. However, extension modules will need to be modified properly support subinterpreters; e.g. C globals needs to be protected from multiple interpreters.

Numba needs to decide on how multi-interpreters are supported.

Options:

  1. Unsupported.
  2. Complete isolation. Every interpreter is treated as if they are separate process. This will require extension modules to be isolated and LLVM JIT engine to be created per interpreter.
  3. Shared LLVM JIT state. Avoid JITing the same function multiple times. Share JIT engine in the process.

Other things to consider:

  • Managing JITed function lifetime. Interpreters can be created dynamically and destroyed throughout the process lifetime.
  • GPU resources?
  • Rethink all atexit use

Additional reading:

Related discussion for NumPy: https://mail.python.org/archives/list/numpy-discussion@python.org/thread/A3CWGUGK23D33ECXCX6C7JN6OK273KAJ/
How to isolate extensions: https://peps.python.org/pep-0630/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion An issue requiring discussion feature_request
Projects
Status: Observing
Development

No branches or pull requests

1 participant