-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
gpt-bigcode: avoid zero_
to support Core ML
#24755
gpt-bigcode: avoid zero_
to support Core ML
#24755
Conversation
In-place `zeros_` is not supported by the Core ML conversion process. This PR replaces it with `zeros_like` so conversion can proceed. The change only affects a workaround for a PyTorch bug on the `cpu` device.
Note: to fully test conversion of |
The documentation is not available anymore as the PR was closed or merged. |
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 suggest moving the torch.empty to the else to avoid double allocation, otherwise lgtm
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.
Thanks @pcuenca !
@younesbelkada I think this is already fixed in PT. |
We support versions of PyTorch from 1.10 and onward, so we need to keep the workaround for the bug. |
Merging to unblock @pcuenca , let's maybe address @jlamypoirier 's comments in a follow up PR ! |
gpt-bigcode: avoid `zeros_` to support Core ML. In-place `zeros_` is not supported by the Core ML conversion process. This PR replaces it with `zeros_like` so conversion can proceed. The change only affects a workaround for a PyTorch bug on the `cpu` device.
gpt-bigcode: avoid `zeros_` to support Core ML. In-place `zeros_` is not supported by the Core ML conversion process. This PR replaces it with `zeros_like` so conversion can proceed. The change only affects a workaround for a PyTorch bug on the `cpu` device.
What does this PR do?
In-place
zero_
is not supported by the Core ML conversion process. This PR replaces it withzeros_like
so conversion can proceed.The change only affects a workaround for a PyTorch bug on the
cpu
device.Fixes # (issue)
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@younesbelkada, @loubnabnl, @jlamypoirier