colesbury / nogil-3.12

Multithreaded Python without the GIL (experimental rebase on 3.12)
Other
145 stars 7 forks source link

Investigating nogil-3.12 with numpy #9

Closed lesteve closed 5 months ago

lesteve commented 1 year ago

I was curious about the status of nogil-3.12 for scientific Python packages so I started with numpy.

Cherry-picking the additional commits in https://github.com/colesbury/numpy/commits/v1.24.0-nogil, I managed to have something that builds and imports there https://github.com/lesteve/numpy/tree/nogil-3.12. This is numpy development version 2.0.0.dev0 which is compatible with Python 3.12.

I get some segmentation faults when trying to run the tests. It could well be that other parts of numpy need fixing since the latest numpy for nogil is 1.24 and the numpy development version is now 2.0.0.dev0.

I guess I am mostly wondering about:

An answer like "this is probably not the highest priority right now, maybe come back in x months" would be totally acceptable :wink:!

colesbury commented 1 year ago

Hi @lesteve - I haven't put any effort into getting extensions to work with nogil-3.12 so I don't expect them to work. The goal of nogil-3.12 is more limited than nogil-3.9 - to get performance numbers to support PEP 703.

I'm not working much on nogil until a decision on PEP 703 is made. I'll be on vacation until around August 7, so actually I'm not working on much of anything at all :)

If PEP 703 is accepted then NumPy support will be high priority. Lysandros Nikolaou at Quansight has offered to help with that then.

lesteve commented 1 year ago

Thanks a lot for your answer, enjoy your holidays!

I guess my main motivation was curiosity but also to keep showing explicit interest in the nogil effort. As you probably know, the scikit-learn project would love to see PEP 703 accepted :crossed_fingers:

ofek commented 1 year ago

until a decision on PEP 703 is made

The Steering Council has announced their intent to accept 🙂 https://discuss.python.org/t/a-steering-council-notice-about-pep-703-making-the-global-interpreter-lock-optional-in-cpython/30474

lesteve commented 5 months ago

Closing, since the focus is now on Python 3.13, see for example https://github.com/Quansight-Labs/free-threaded-compatibility/.