-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Closed
Labels
00 - Bug39 - free-threadingPRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)
Description
Describe the issue:
Using np.finfo and np.iinfo with Python 3.13/numpy 2.1 free-threading can lead to errors like the following:
> return ml_dtypes.finfo(dtype).min < 0
E RuntimeError: Identity cache already includes an item with this key.
(source: https://github.com/jax-ml/ml_dtypes/actions/runs/10840175629/job/30081990075?pr=188)
ml_dtypes.finfo inherits from numpy.finfo, and this error is coming from the NumPy implementation; looks to be a race condition when multiple threads hit the Identity cache at once.
Python and NumPy Versions:
Python 3.13; numpy 2.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
00 - Bug39 - free-threadingPRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)