You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue documents the current state of support for Apple M-series (M1/M2) support in Thinc and spacy-transformers. Subscribe to this issue if you'd like to receive status updates on support for M-series GPUs.
Thinc layers
Apple M-series (M1/M2) GPUs are currently not used by Thinc models. The matrix multiplication (AMX) units of the M-series CPUs will be used when thinc-apple-ops is installed.
PyTorch layers
M-series GPUs are supported by the PyTorch wrapper in Thinc. Calling require_gpu or prefer_gpu changes the default PyTorch device to mps. As a result, Metal Performance Shaders will be used by PyTorch to run compute kernels on the GPU.
Keep in mind though that the Metal Performance Shader support is still fairly limited, especially so in PyTorch 1.12.x, as a consequence your models may not work correctly.
spacy-transformers
spacy-transformers 1.1.8 adds experimental support for M1 GPUs through Metal Performance Shaders. However, this support comes with some limitations:
Only inference is supported.
PyTorch 1.13.x is required. Even though PyTorch 1.12.x adds support for MPS, it is too incomplete to use with spacy-transformers.
We have not tested MPS support on Intel Macs with Metal-capable GPUs.
We have tested the following models with MPS, PyTorch 1.13.0 and spacy-transformers 1.1.8. The models for which Requires fallback is ticked only work with the PYTORCH_ENABLE_MPS_FALLBACK=1 environment variable set.
This issue documents the current state of support for Apple M-series (M1/M2) support in Thinc and spacy-transformers. Subscribe to this issue if you'd like to receive status updates on support for M-series GPUs.
Thinc layers
Apple M-series (M1/M2) GPUs are currently not used by Thinc models. The matrix multiplication (AMX) units of the M-series CPUs will be used when
thinc-apple-ops
is installed.PyTorch layers
M-series GPUs are supported by the PyTorch wrapper in Thinc. Calling
require_gpu
orprefer_gpu
changes the default PyTorch device tomps
. As a result, Metal Performance Shaders will be used by PyTorch to run compute kernels on the GPU.Keep in mind though that the Metal Performance Shader support is still fairly limited, especially so in PyTorch 1.12.x, as a consequence your models may not work correctly.
spacy-transformers
spacy-transformers
1.1.8 adds experimental support for M1 GPUs through Metal Performance Shaders. However, this support comes with some limitations:spacy-transformers
.We have tested the following models with MPS, PyTorch 1.13.0 and
spacy-transformers
1.1.8. The models for which Requires fallback is ticked only work with thePYTORCH_ENABLE_MPS_FALLBACK=1
environment variable set.You can find more information about using
spacy-transformers
with M-series GPUs in the GPU Support Troubleshooting FAQ.Benchmarks
More background about the MPS support, including benchmarks, can be found in our blog post Fast transformer inference with Metal Performance Shaders.
The text was updated successfully, but these errors were encountered: