Skip to content

Do not try to fold op.SplitToSequence when split is None#2550

Merged
titaiwangms merged 1 commit intomicrosoft:mainfrom
titaiwangms:titaiwang/split_to_seq_fix
Sep 8, 2025
Merged

Do not try to fold op.SplitToSequence when split is None#2550
titaiwangms merged 1 commit intomicrosoft:mainfrom
titaiwangms:titaiwang/split_to_seq_fix

Conversation

@titaiwangms
Copy link
Copy Markdown
Contributor

@titaiwangms titaiwangms commented Sep 8, 2025

split is an optional input to op.SplitToSequence.

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 8, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.49%. Comparing base (9036fab) to head (2e86ea5).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
onnxscript/optimizer/_constant_folding.py 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2550      +/-   ##
==========================================
+ Coverage   70.37%   70.49%   +0.11%     
==========================================
  Files         218      218              
  Lines       26428    26430       +2     
  Branches     2646     2647       +1     
==========================================
+ Hits        18600    18633      +33     
+ Misses       6922     6889      -33     
- Partials      906      908       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-project-automation github-project-automation Bot moved this from Todo to Done in ONNX Script Review Board Sep 8, 2025
@titaiwangms titaiwangms merged commit cec5396 into microsoft:main Sep 8, 2025
29 of 32 checks passed
"""
input = node.inputs[0]
if len(node.inputs) == 1:
# split is not provided
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When split is not provided it is a scalar 1. Can we use this info?

Copy link
Copy Markdown
Contributor Author

@titaiwangms titaiwangms Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it? The issue @xadupre brought up was only one input. model id: facebook/sam-vit-base, so it hit indexerror.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return op.SplitToSequence(self, axis=dim, keepdims=False)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably came from here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

2 participants