Skip to content
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

Compatibility with Transformers 4.36 #1590

Merged
merged 9 commits into from
Dec 13, 2023

Conversation

fxmarty
Copy link
Contributor

@fxmarty fxmarty commented Dec 12, 2023

As per title.

  • Support SDPA ONNX export.
  • Fix Whisper that now uses in generate attributes as self.model that are not accessible to us.
  • Fix Falcon following the KV cache refactor (now 4D instead of 3D before).

Failing XLM and sew_d tests are not due to us, see https://huggingface.slack.com/archives/C014N4749J9/p1702463890741009?thread_ts=1702373869.327359&cid=C014N4749J9 & huggingface/transformers#28000

Comment on lines +360 to +362
# TODO: Fix in Transformers so that SdpaAttention class can be exported to ONNX. `attn_implementation` is introduced in Transformers 4.36.
if model_type in SDPA_ARCHS_ONNX_EXPORT_NOT_SUPPORTED and _transformers_version >= version.parse("4.35.99"):
loading_kwargs["attn_implementation"] = "eager"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bart decoder and Whisper encoder + decoder should be fixable since the query length is static there (so no need to actually have a controlflow on it).

And for bart encoder, we are always non-causal no matter q_len so we could just rely on that.

This was referenced Dec 12, 2023
@fxmarty fxmarty changed the title Fix tests following Transformers release Compatibility with Transformers 4.36 Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant