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
ENH: Support free-threaded python build (tracking issue) #26157
Comments
Maybe another interesting resource is the past work done by Sam Gross to patch numpy to make it work well enough with the original Things might have drifted a bit since that time, but those patches are enough to get the scikit-learn test suite pass with |
It looks like numpy's main branch passes the full numpy test suite with the gil disabled. I've been testing using the There are still a ton of threading bugs I'm sure because of limited use of threads in the tests - we need better test coverage for threaded workflows. I'm already aware of a number of internal caches we'll likely need to disable or add locking for. But, it's a good start! |
Just curious, are contributors planning to work on #24755 or is there any overlap where work for nogil would also help with allowing subinterpreters? |
While this does have some overlap with work on subinterpreters since the C thread safety issues we're working on apply to subinterpreters as well, the bulk of the work required to support subinterpreters - converting numpy's extension types from single-phase to multi-phase initialization - is not required and we are not currently planning to do that. |
Myself, @lysnikolaou, and @rgommers are working on a new project in collaboration with the Python Runtime team at Meta to add support for Python 3.13 nogil builds in the scientific python software stack.
Our initial minimal goal is a build of NumPy that runs and passes all the tests in a nogil build of Python.
Resources:
Backlog
PyDict_GetItem
andPyList_GetItem
to use variants returning strong references (MNT: Replace C API usages that return borrowed references #26159)--disable-gil
build (TST: add basic free-threaded CI testing #26463)npy_cache_import
is implemented using thread-safe CPython C API constructswrapping_array_method.c
uses a freelist that is certainly not thread safe. It has no internal consumers besides_scaled_float_dtype
to test the implementation so ignoring it for now.ErrState
may need to be made per-thread or synchronized across threads.The text was updated successfully, but these errors were encountered: