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

Add device to TorchScriptTensor #1483

Merged
merged 3 commits into from
Apr 30, 2024

Conversation

titaiwangms
Copy link
Contributor

In torchlib, we have device specific onnx function, therefore, we need TorchScriptTensor to carry device property, so converter dispatcher can dispatch the best fitted function to the ATen op.

Copy link

codecov bot commented Apr 30, 2024

Codecov Report

Attention: Patch coverage is 95.83333% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 76.86%. Comparing base (7b10687) to head (0331c0d).

Files Patch % Lines
...ibs/torch_lib/graph_building/_graph_building_ir.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1483      +/-   ##
==========================================
+ Coverage   76.84%   76.86%   +0.01%     
==========================================
  Files         209      209              
  Lines       22461    22484      +23     
  Branches     3811     3816       +5     
==========================================
+ Hits        17260    17282      +22     
- Misses       4482     4483       +1     
  Partials      719      719              

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

@justinchuby
Copy link
Collaborator

Lgtm. Could you create a test?

@titaiwangms
Copy link
Contributor Author

Lgtm. Could you create a test?

Yes. could you point out the TorchScriptTensor related tests at?

@justinchuby
Copy link
Collaborator

I would just create one here, if possible: https://github.com/microsoft/onnxscript/blob/main/onnxscript/function_libs/torch_lib/graph_building/graph_building_test.py

@titaiwangms titaiwangms merged commit 4edf95c into microsoft:main Apr 30, 2024
30 of 42 checks passed
justinchuby pushed a commit that referenced this pull request May 1, 2024
In torchlib, we have [device specific onnx
function](https://github.com/microsoft/onnxscript/blob/8dba367fb000e3696c79b618638861b5cdf759dc/onnxscript/function_libs/torch_lib/ops/core.py#L5797-L5804),
therefore, we need `TorchScriptTensor` to carry device property, so
converter dispatcher can dispatch the best fitted function to the ATen
op.
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