-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
static cache: RuntimeError: cannot mutate tensors with frozen storage #33178
Comments
For huggingface#33178 Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Found also this issue on pytorch side which seem relevant:
|
Workaround in #33287 |
The workaround proposed by @guangy10 sounds better as it doesn't involve copying ! |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
This issue was addressed by: |
With:
On:
Test that "static cache works with
torch.export()
" fails with:I observe that adding a
.clone()
to the following 2 tensors does fix the issue. Such solution was suggested in pytorch/pytorch#127571 (comment). However I am not sure whether that's the correct fix. See #33178 draft PR with this change.transformers/src/transformers/cache_utils.py
Lines 1090 to 1091 in 5c1027b
CC: @gante @SunMarc
The text was updated successfully, but these errors were encountered: