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 Python nogil 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
|
This issue aims to collect all the issues and PRs related for the upcoming Python 3.13 nogil 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:
scipy.spatial
_Qhull
→ ENH: spatial: serialize concurrent calls to QHull #20619KDTree/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: