Handle multiple embed nodes in transformer optimizer#4471
Merged
Conversation
Fix temp model path in optimizer Add unit test for gpt2 fusion with past state and mask Add unit test for change input to int32
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description: Describe your changes.
(1) Update fusion of embed layer to handle multiple embed nodes. Remove assumption that a model has only one EmbedLayerNormalization node.
(2) Fix temp model path in optimizer. Add a check that whether temp path is used.
(3) Add unit test for gpt2 fusion with past state and mask.
(4) Add unit test for change input to int32
Motivation and Context
Some models from customer have multiple embed nodes. Current optimizer will throw assert exception (since we assumed there is only one embed per graph). This change make optimizer works on such model by removing such assumption.