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:
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:
PEP 703
Fork of numpy 1.24 with early nogil support
Add changelog entry and docs describing the current state of using NumPy in a multithreaded environment.
Convert
PyDict_GetItemandPyList_GetItemto use variants returning strong references (MNT: Add linter for thread-unsafe C API uses #26159)TSK: Make NumPy buildable on the nogil branch #26161
Set up CPython 3.13 CI
--disable-gilbuild (TST: add basic free-threaded CI testing #26463)Make the test suite pass with the gil disabled
Mark NumPy C extensions with
Py_MOD_GIL_NOT_USED.Allow building f2py extensions that can be imported without the GIL.
Use PyMutex instead of PyThread_type_lock
Nightly wheels for
cp313tABIGlobal state
_multiarray_umathreorganized into structs: MNT: Reorganize non-constant global statics into structs #26607wrapping_array_method.cuses a freelist that is certainly not thread safe. It has no internal consumers besides_scaled_float_dtypeto test the implementation so ignoring it for now.NPY_NUMUSERTYPES, which also unfortunately is part of the public C API. This one may just need to remain unfixed, given it's in a legacy API.np.set_string_functionandPyArray_SetStringFunctionare implemented using static global state.np.set_string_functionimplementation should be removed #26576, MNT: Removeset_string_function#26611NUMPY_WARN_IF_NO_MEMORY_POLICYis implemented using a global static. The only public interface is via an environment variable read at module initialization but it's tested using a thread-unsafe interface.