Add position ids in ONNX export and ORT#1381
Merged
fxmarty merged 10 commits intohuggingface:mainfrom Sep 18, 2023
Merged
Conversation
Co-authored-by: Kunal Vaishnavi <kvaishnavi@microsoft.com> Co-authored-by: "Feng, Jiqing" <jiqing.feng@intel.com>
This was referenced Sep 14, 2023
Closed
Contributor
|
Thanks for this fix @fxmarty! I'll be testing this with transformers.js hopefully soon. |
michaelbenayoun
approved these changes
Sep 18, 2023
Member
michaelbenayoun
left a comment
There was a problem hiding this comment.
Thanks for handling this @fxmarty
Comment on lines
+89
to
+90
| # TODO: remove no_position_ids once optimum is sufficiently above 1.13 | ||
| self.no_position_ids = no_position_ids |
Member
There was a problem hiding this comment.
Should we make helper function like deprecated(version_number) that does nothing when the version is lower than that and fails after?
This way we dont forget to remove deprecated code.
This was referenced Sep 25, 2023
3 tasks
3 tasks
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.
Supersede #1289 & #984
Fix a critical issue where the exported ONNX models could not produce meaningful results for batch size > 1 due to a very strong assumption in transformers: that all sequences are of the same length if
position_idsis not passed. See: https://github.com/huggingface/transformers/blob/a796f7eea6c86b54671a6f522cebbe41f630bb62/src/transformers/models/gpt2/modeling_gpt2.py#L802Left to do:
main)cc @xenova