-
Notifications
You must be signed in to change notification settings - Fork 114
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
support mps backend. #59
Conversation
Thanks @ninehills. Short question: Does MPS really conflict with BetterTransformer, or whats the motivation in deactivating it? |
The following is the error message when using MPS and BetterTransformer: File "/Users/xxx/src/github.com/ninehills/infinity/libs/infinity_emb/.venv/lib/python3.11/site-packages/optimum/bettertransformer/models/encoder_models.py", line 301, in forward
hidden_states = torch._nested_tensor_from_mask(hidden_states, ~attention_mask)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
NotImplementedError: The operator 'aten::_nested_tensor_from_mask' is not currently implemented for the MPS device. If you want this op to be added in priority during the prototype phase of this feature, please comment on https://github.com/pytorch/pytorch/issues/77764. As a temporary fix, you can set the environment variable `PYTORCH_ENABLE_MPS_FALLBACK=1` to use the CPU as a fallback for this op. WARNING: this will be slower than running natively on MPS. Test torch different versions, all have the same problem.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would merge the branch as is, if the tests are all passing. Thanks for submitting
If we set
|
Okay, got it. There is no nested_tensor for Pytorch MPS, hence we should skip the |
No description provided.