-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Tracker: Support free-threaded CPython builds #20669
Comments
Here is a list of classes in SciPy, which can be of interest, since they could have shared state that can mutate under multithreading: https://gist.github.com/andfoy/955bf6ceee8437b2092df19202490981. Feel free to comment if you have any hints or suspicions that a class might be non-thread safe I extracted them by means of the following introspection script: Scriptimport scipy
from inspect import isclass, ismodule, getmembers
cls_set = set({})
visited = set({})
queue = [scipy]
while queue != []:
mod_or_class = queue.pop(0)
if mod_or_class in visited:
continue
print(mod_or_class)
if ismodule(mod_or_class) and mod_or_class.__name__.startswith('scipy'):
for _, mem in getmembers(mod_or_class):
if ismodule(mem) and mem.__name__.startswith('scipy'):
queue.append(mem)
elif isclass(mem):
queue.append(mem)
elif isclass(mod_or_class):
cls_module = mod_or_class.__module__
cls_name = mod_or_class.__name__
fully_qual = f'{cls_module}.{cls_name}'
if cls_module.startswith('scipy') and fully_qual not in cls_set:
print(fully_qual)
cls_set |= {fully_qual}
visited |= {mod_or_class}
classes = sorted(cls_set)
for cls_name in classes:
print(cls_name) |
A couple of thoughts:
|
"implicit save" might be a build problem though, not sure TBH: #6882 (comment) |
About
|
@ilayn sorry for the slow reply. I think ARPACK/PROPACK are probably the biggest bang for the buck. They are full of bugs that are impossible to fix. It will help with introducing support for free-threaded CPython, and at the same time (more important even) it will fix a host of crashes and failures. There's also several unfinished PRs open that attempt to upgrade ARPACK from 3.3.0 to 3.7.0/3.8.0 that ran into trouble. |
Yes, I finally got the distance on |
This issue aims to collect all the issues and PRs related for the upcoming free-threaded CPython 3.13 (a.k.a. "no-GIL") builds.
The outline of this issue will detail the compatibility of each module in the SciPy namespace against nogil builds, specially with class APIs, which may suffer of concurrency issues due to state sharing when multiple threads share the same object instances.
Until now, as of #20611 all the test suite is passing using the latest NumPy after numpy/numpy#26348.
Resources:
CI jobs
manylinux
andmusllinux
): CI: Add workflow to build and upload free-threaded wheels #20882scipy.spatial
_Qhull
→ ENH: spatial: serialize concurrent calls to QHull #20619, BUG: prevent QHull message stream being closed twice #20611KDTree/cKDTree
→ ENH: spatial: ensure thread-safety for KDTree #20655scipy.interpolate
BSpline
→ ENH: interpolate: fix concurrency issues throughout #20671The text was updated successfully, but these errors were encountered: