You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changes the way num_hidden_layers, batch_size and sequence_length are calculated, and slices attention_mask, so that the shapes of expert_attention_mask and expert_mask match, thus making it compatible with inference with past_key_values
During inference, people may want to check the router logits, and currently due to the imcompatible shape of attention_mask and all_router_logits when past_key_values is enabled, it will raise an error. Since aux_loss does not depend on labels, it is also possible to check aux_loss in inference.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Changes the way
num_hidden_layers,batch_sizeandsequence_lengthare calculated, and slicesattention_mask, so that the shapes ofexpert_attention_maskandexpert_maskmatch, thus making it compatible with inference withpast_key_valuesFixes #30731
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@ArthurZucker