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

[API] Create stable APIs for PyTorch 2.5 #1832

Merged
merged 16 commits into from
Aug 30, 2024
Merged

Conversation

justinchuby
Copy link
Collaborator

@justinchuby justinchuby commented Aug 27, 2024

Create stable APIs for PyTorch 2.5 so that it does not need to use any internal ONNX Script APIs. Created APIs are

"check_model",
"convert_version",
"get_torchlib_ops",
"optimize",
"save_model_with_external_data",

In pytorch, it is expected to write:

import onnxscript._framework_apis.torch_2_5

Fixes #1827

Copy link

codecov bot commented Aug 27, 2024

Codecov Report

Attention: Patch coverage is 38.33333% with 37 lines in your changes missing coverage. Please review.

Project coverage is 75.04%. Comparing base (e037aa0) to head (014c676).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
onnxscript/_framework_apis/torch_2_5.py 38.33% 37 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1832      +/-   ##
==========================================
- Coverage   75.13%   75.04%   -0.09%     
==========================================
  Files         248      249       +1     
  Lines       26977    27037      +60     
  Branches     4926     4937      +11     
==========================================
+ Hits        20268    20291      +23     
- Misses       5762     5800      +38     
+ Partials      947      946       -1     

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

onnxscript/_framework_apis/__init__.py Fixed Show fixed Hide fixed
onnxscript/_framework_apis/torch_2_5.py Fixed Show fixed Hide fixed
onnxscript/_framework_apis/torch_2_5.py Fixed Show fixed Hide fixed
onnxscript/_framework_apis/torch_2_5.py Fixed Show fixed Hide fixed
onnxscript/_framework_apis/torch_2_5.py Fixed Show fixed Hide fixed
onnxscript/_framework_apis/torch_2_5.py Fixed Show fixed Hide fixed
onnxscript/_framework_apis/torch_2_5.py Fixed Show fixed Hide fixed
onnxscript/_framework_apis/torch_2_5.py Fixed Show fixed Hide fixed
onnxscript/_framework_apis/torch_2_5.py Fixed Show fixed Hide fixed
onnxscript/_framework_apis/torch_2_5.py Fixed Show fixed Hide fixed
def check_model(model: ir.Model) -> None:
"""Check the model."""

del model # Unused yet

Check warning

Code scanning / CodeQL

Unnecessary delete statement in function Warning

Unnecessary deletion of local variable
model
in function
check_model
.
Copy link

github-actions bot commented Aug 27, 2024

Test Results

     24 files  ±0      24 suites  ±0   2h 41m 36s ⏱️ - 10m 28s
 14 119 tests ±0  11 748 ✅ +1    2 333 💤 ±0   32 ❌  - 1   6 🔥 ±0 
354 880 runs  ±0  81 040 ✅ +1  273 586 💤 ±0  212 ❌  - 1  42 🔥 ±0 

For more details on these failures and errors, see this check.

Results for commit 014c676. ± Comparison against base commit e037aa0.

♻️ This comment has been updated with latest results.

@justinchuby justinchuby added the hold on merging Don't merge yet label Aug 29, 2024
onnxscript/_framework_apis/torch_2_5.py Outdated Show resolved Hide resolved
onnxscript/_framework_apis/torch_2_5.py Show resolved Hide resolved
onnxscript/_framework_apis/torch_2_5.py Show resolved Hide resolved
onnxscript/_framework_apis/torch_2_5.py Show resolved Hide resolved
onnxscript/_framework_apis/torch_2_5.py Show resolved Hide resolved
onnxscript/_framework_apis/torch_2_5.py Show resolved Hide resolved
@justinchuby justinchuby enabled auto-merge (squash) August 30, 2024 19:29
@justinchuby justinchuby enabled auto-merge (squash) August 30, 2024 19:29
@justinchuby justinchuby removed the hold on merging Don't merge yet label Aug 30, 2024
@justinchuby justinchuby merged commit 540696c into main Aug 30, 2024
27 of 43 checks passed
@justinchuby justinchuby deleted the justinchu/stable-torch branch August 30, 2024 19:59
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.

[RFC] Create APIs for pytorch
4 participants