Skip to content

Supported C API Extensions

Sam Gross edited this page Apr 14, 2022 · 13 revisions

The table below lists C API extensions with pre-built pip wheels that are compatible with "nogil" Python, as well as a few popular extensions that do not currently work with nogil Python.

Note that even the "supported" extensions are not well tested. Please file GitHub issue if you run into any problems.

Some extensions require changes to correctly work with nogil Python. The link to these changes are in the "fork" column.

Extension Status Versions Fork
cffi OK cffi
cryptography OK 36.0.2
cymem OK
cython OK 0.29.26 cython
h5py OK
jax OK 0.1.75 jax
kiwisolver OK
llvmlite OK 0.37.0
lxml OK
markupsafe OK
matplotlib OK
numba Not working
numpy OK 1.19.3,1.19.4 numpy
opencv-python OK
orjson OK
pglast OK pglast
pillow OK 8.4.0
protobuf TODO
psycopg2-binary OK
pyarrow Not working
pybind11 OK 2.6.2 pybind11
pydantic OK 1.8.2
pytorch OK 1.9.0 (CUDA 11.0)
scikit-learn OK 1.0.2
scipy OK scipy
spacy OK
thinc OK
torchvision OK 0.10.0

Notes

Jax

Seems to work, but I'm not sure about using Jax from multiple threads. Need someone with Jax expertise.

Numba

The interpreter.py file needs to be updated for the nogil interpreter's bytecode.

PyArrow

I haven't figured out how to build it from source yet.

PyTorch

Believed to work well.