-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Update rotary_embedding reference implementation and tests #7304
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
Merged
titaiwangms
merged 4 commits into
onnx:main
from
titaiwangms:titaiwang/fix_rotary_embedding_ref
Sep 15, 2025
Merged
Update rotary_embedding reference implementation and tests #7304
titaiwangms
merged 4 commits into
onnx:main
from
titaiwangms:titaiwang/fix_rotary_embedding_ref
Sep 15, 2025
Conversation
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
Signed-off-by: Ti-Tai Wang <[email protected]>
59c30bd to
19b3a5e
Compare
Signed-off-by: Ti-Tai Wang <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7304 +/- ##
==========================================
- Coverage 54.35% 54.34% -0.01%
==========================================
Files 511 511
Lines 31837 31839 +2
Branches 2850 2852 +2
==========================================
- Hits 17304 17302 -2
- Misses 13755 13757 +2
- Partials 778 780 +2 ☔ View full report in Codecov by Sentry. |
justinchuby
reviewed
Sep 15, 2025
Signed-off-by: Ti-Tai Wang <[email protected]>
justinchuby
reviewed
Sep 15, 2025
justinchuby
approved these changes
Sep 15, 2025
Signed-off-by: Ti-Tai Wang <[email protected]>
justinchuby
pushed a commit
that referenced
this pull request
Sep 22, 2025
### Description <!-- - Describe your changes. --> Add assertion in reference op of rotary embedding to follow ONNX spec. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? --> <!-- - If it fixes an open issue, please link to the issue here. --> In ONNX spec, `cos_cache` and `sin_cache` are explicitly stated to have either rotary_embedding_dim/2 or head_size/2 in the final dim. However, reference op did not force it. --------- Signed-off-by: Ti-Tai Wang <[email protected]>
justinchuby
added a commit
that referenced
this pull request
Sep 22, 2025
) (#7313) Cherrypick of - #7304 - #7316 --------- Signed-off-by: Ti-Tai Wang <[email protected]> Co-authored-by: Ti-Tai Wang <[email protected]>
Closed
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
Add assertion in reference op of rotary embedding to follow ONNX spec.
Motivation and Context
In ONNX spec,
cos_cacheandsin_cacheare explicitly stated to have either rotary_embedding_dim/2 or head_size/2 in the final dim. However, reference op did not force it.