Skip to content

Improves aten_chunk conversion #2434

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Improves aten_chunk conversion #2434

wants to merge 4 commits into from

Conversation

xadupre
Copy link
Member

@xadupre xadupre commented Jul 3, 2025

No description provided.

Copy link

codecov bot commented Jul 3, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 69.25%. Comparing base (3f2f7d3) to head (ae1a0d6).

Files with missing lines Patch % Lines
onnxscript/function_libs/torch_lib/ops/core.py 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2434      +/-   ##
==========================================
+ Coverage   69.23%   69.25%   +0.02%     
==========================================
  Files         210      210              
  Lines       25389    25381       -8     
  Branches     2546     2546              
==========================================
+ Hits        17577    17578       +1     
+ Misses       6939     6929      -10     
- Partials      873      874       +1     

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

Copy link
Contributor

@titaiwangms titaiwangms left a comment

Choose a reason for hiding this comment

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

The original code references on torchscript symbolic function implementation. Could you explain why the op could work on this way? And could you update the code, because g does not make any sense.

@justinchuby justinchuby added the module: torchlib Related to the torch/aten function lib in development label Jul 3, 2025
return op.SplitToSequence(self, list_split, axis=dim)
if chunks == 1:
return g.op.Identity(self)
return g.op.Split(self, axis=dim, num_outputs=chunks)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks - the change looks good except for the use of g. Could you update usage? We can then merge

return op.SplitToSequence(self, list_split, axis=dim)
if chunks == 1:
return op.Identity(self)
return op.Split(self, axis=dim, num_outputs=chunks)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I will need to fix the graph builder to return the correct number of outputs

@justinchuby justinchuby added this to the 0.4 milestone Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: torchlib Related to the torch/aten function lib in development
Projects
Development

Successfully merging this pull request may close these issues.

3 participants