This is a tracker issue for adding free-threading support to statsmodels. See https://py-free-threading.github.io/ for a overview of how free-threading can be supported by extension modules.
This can done in three steps incrementally:
- First step is to add 3.14t CI to
statsmodels without making any changes to ensure that statsmodels can be compiled under free-threading. This would re-enable the GIL at runtime.
- Next step is to fix thread safety issues of
statsmodels and decide on the thread safety guarantees of statsmodels. After that statsmodels can disable the GIL being re-enabled again. The thread safety can be verified by running tests using pytest-run-parallel under TSAN.
- Last step would be to add CI with
pytest-run-parallel after all the thread safety work is complete to ensure that the implementation remains thread safe.
For the thread safety work, statsmodels depends on numpy, pandas and a few other libraries which have thread safety issues that are currently under work like numpy/numpy#30426. I'll update this issue as these blockers are fixed.
This is a tracker issue for adding free-threading support to
statsmodels. See https://py-free-threading.github.io/ for a overview of how free-threading can be supported by extension modules.This can done in three steps incrementally:
statsmodelswithout making any changes to ensure thatstatsmodelscan be compiled under free-threading. This would re-enable the GIL at runtime.statsmodelsand decide on the thread safety guarantees ofstatsmodels. After thatstatsmodelscan disable the GIL being re-enabled again. The thread safety can be verified by running tests usingpytest-run-parallelunder TSAN.pytest-run-parallelafter all the thread safety work is complete to ensure that the implementation remains thread safe.For the thread safety work,
statsmodelsdepends onnumpy,pandasand a few other libraries which have thread safety issues that are currently under work like numpy/numpy#30426. I'll update this issue as these blockers are fixed.