Skip to content
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

[torchlib] Fix aten::arange to support dynamic shapes #1913

Merged
merged 6 commits into from
Oct 23, 2024

Conversation

titaiwangms
Copy link
Contributor

Runinng SmolLM_1_7b with dynamic shapes discovered that arange.start was not dynamic anymore, since https://github.com/microsoft/onnxscript/pull/1781/files.

@titaiwangms titaiwangms changed the title Make arange.start dynamic again [torchlib] Fix aten::arange to support dynamic shapes Oct 22, 2024
Copy link
Collaborator

@justinchuby justinchuby left a comment

Choose a reason for hiding this comment

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

Thanks, also interesting - does this mean we need to update https://github.com/pytorch/pytorch/blob/10f16cc7daf89a73c1177dfbd0bb0fbb0fc8683b/aten/src/ATen/native/native_functions.yaml#L780 ? Should we create an issue for propose a fix?

@justinchuby justinchuby added the topic: torch_lib Related to the torch/aten function lib in development label Oct 22, 2024
@justinchuby
Copy link
Collaborator

Should we also fix the rest of the arange overloads?

Copy link

codecov bot commented Oct 22, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 12 lines in your changes missing coverage. Please review.

Project coverage is 75.45%. Comparing base (f18dadc) to head (0c9c48e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
onnxscript/function_libs/torch_lib/ops/core.py 66.66% 8 Missing and 4 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1913   +/-   ##
=======================================
  Coverage   75.45%   75.45%           
=======================================
  Files         252      252           
  Lines       27327    27335    +8     
  Branches     3172     3171    -1     
=======================================
+ Hits        20619    20626    +7     
  Misses       5745     5745           
- Partials      963      964    +1     

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

@titaiwangms
Copy link
Contributor Author

Should we also fix the rest of the arange overloads?

Sure, I can update the whole family. And record the question that does Scalar cover sym_int and sym_float in Meta doc.

@titaiwangms titaiwangms added merge at lgtm Reviewers can merge when they approve and removed merge at lgtm Reviewers can merge when they approve labels Oct 23, 2024
@xadupre
Copy link
Member

xadupre commented Oct 23, 2024

Is it possible to add a unit test to make sure there is no regression about this?

@titaiwangms
Copy link
Contributor Author

Is it possible to add a unit test to make sure there is no regression about this?

I will merge this first to unblock the model, and then come up with tests as follow-up.

@justinchuby
Copy link
Collaborator

justinchuby commented Oct 23, 2024

The old arange logic had issues with inconsistent types. Please make sure that's resolved. I am happy if you fix one and take time to ensure the rest of the variants are correct in a separate PR, if that allows faster progress

@titaiwangms titaiwangms enabled auto-merge (squash) October 23, 2024 16:44
@titaiwangms titaiwangms enabled auto-merge (squash) October 23, 2024 22:00
@titaiwangms titaiwangms merged commit 2b60939 into microsoft:main Oct 23, 2024
26 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: torch_lib Related to the torch/aten function lib in development
Projects
Development

Successfully merging this pull request may close these issues.

3 participants