-
Notifications
You must be signed in to change notification settings - Fork 71
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
Bump transformers version to 4.48.1 #771
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
In order to be able to be independent of optimum releases to update optimum-neuron transformer dependency, we now recommend a direct installation instead of installing optimum-neuron as an optimum extra.
668423c
to
565639f
Compare
This is because otherwise contronel-aux will pull an extremely old version of timm.
The parallelization code expects these parameters to be set. A proper fix would be to write a specific Llama parallel model.
The transformation code expects some attributes to be set.
565639f
to
2fc13fc
Compare
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.
lgtm, thanks.
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.
LGTM!
# FIXME: temporary workaround to avoid too many changes in the transformation code | ||
layer.self_attn.num_heads = layer.self_attn.config.num_attention_heads | ||
layer.self_attn.num_key_value_heads = layer.self_attn.config.num_key_value_heads | ||
layer.self_attn.hidden_size = layer.self_attn.config.hidden_size |
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!
What does this PR do?
This bumps the transformers version to 4.48.1 to allow the deployment of images containing
optimum-neuron
in AWS services (all previous transformers versions are now rejected because they include some scripts identified as potentially harmful).This also modifies the documentation to change the installation instructions: installing as an optimum extra is no longer recommended and will be soon deprecated.
There were some changes in transformers modeling for LLama and Mistral models attention forward that needed to be reflected in the distributed parallelization modeling code.
There were also some changes in the attributes of the transformers Attention classes for the same models that broke the parallelization dynamic transformations: the changes in this pull-request are just a workaround, and eventually these dynamic transformations should be replaced by explicit modeling code (the forward methods are already overloaded, so there is no point in patching dynamically the layers where it would be simpler to recreate them directly from the config).