Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@titaiwangms
Copy link
Contributor

Description

Add assertion in reference op of rotary embedding to follow ONNX spec.

Motivation and Context

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.

@titaiwangms titaiwangms requested a review from a team as a code owner September 15, 2025 20:27
@github-project-automation github-project-automation bot moved this to In progress in PR Tracker Sep 15, 2025
Signed-off-by: Ti-Tai Wang <[email protected]>
@titaiwangms titaiwangms force-pushed the titaiwang/fix_rotary_embedding_ref branch from 59c30bd to 19b3a5e Compare September 15, 2025 20:32
Signed-off-by: Ti-Tai Wang <[email protected]>
@codecov
Copy link

codecov bot commented Sep 15, 2025

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.34%. Comparing base (be3e379) to head (c345a5e).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
onnx/backend/test/case/node/rotaryembedding.py 0.00% 6 Missing ⚠️
onnx/reference/ops/op_rotary_embedding.py 0.00% 2 Missing and 2 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

@justinchuby justinchuby added this to the 1.19.1 milestone Sep 15, 2025
@justinchuby justinchuby changed the title Update rotary_embedding Update rotary_embedding reference implementation and tests Sep 15, 2025
Signed-off-by: Ti-Tai Wang <[email protected]>
@github-project-automation github-project-automation bot moved this from In progress to Reviewer approved in PR Tracker Sep 15, 2025
Signed-off-by: Ti-Tai Wang <[email protected]>
@titaiwangms titaiwangms enabled auto-merge (squash) September 15, 2025 22:07
@titaiwangms titaiwangms merged commit be00bbc into onnx:main Sep 15, 2025
34 checks passed
@github-project-automation github-project-automation bot moved this from Reviewer approved to Done in PR Tracker Sep 15, 2025
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]>
@yuanyao-nv yuanyao-nv mentioned this pull request Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants