-
Notifications
You must be signed in to change notification settings - Fork 27.8k
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
Output from model.Generate & model.forward not same when output attention/hidden_state is True #32117
Comments
Hi @AamodThakur 👋 The differences are expected :) You are hitting an edge case of the optimized SDPA attention (the implementation used by default) when You should also be getting a warning like "GemmaModel is using GemmaSdpaAttention, but For reference, here are the relevant code lines: transformers/src/transformers/models/gemma/modeling_gemma.py Lines 489 to 503 in 0a7af19
|
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. |
System Info
transformers
version: 4.42.4Who can help?
@gante @arth
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Common Step:
Case 1:
Case 2:
We are getting output of generate function & output of Case 2 same. But for output Case 1 is different because we have set "output_attentions=True, output_hidden_states=True" which we believe should be used for debugging purpose.
Expected behavior
Output of generate should be same as Case 1 & Case 2's output.
The text was updated successfully, but these errors were encountered: