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

↔ [Converter] Add Dynamo converters for all Elementwise ATen Operators #2127

Closed
gs-olive opened this issue Jul 20, 2023 · 4 comments
Closed
Assignees
Labels
component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths No Activity Story: ATen Op Support Story: Export/Compile Unification Issues relating to unification of Dynamo compile/export paths

Comments

@gs-olive
Copy link
Collaborator

gs-olive commented Jul 20, 2023

Context

The existing FX operators use different implementations for the elementwise operators than Dynamo does. Specifically, many networks mix Int and Float types for additions, subtractions, multiplications, etc. These tend to cause errors when using the FX converters.

Proposal

Reimplement a light wrapper over each of the elementwise operators in ATen to use the Dynamo implementation of ATen, featured in #2070. Update relevant imports.

Once implemented, remove the following:

@unittest.skip("Pending reimplementation of all binary converters in Dynamo")

@gs-olive gs-olive added Story: ATen Op Support component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths Story: Export/Compile Unification Issues relating to unification of Dynamo compile/export paths labels Jul 20, 2023
@narendasan
Copy link
Collaborator

@gs-olive What in py/torch_tensorrt/dynamo/conversion/impl/elementwise needs to be changed to address this?

@gs-olive
Copy link
Collaborator Author

gs-olive commented Jul 24, 2023

For each of the available elementwise ops, there should be an implementation/decorator in py/torch_tensorrt/dynamo/conversion/aten_ops_converters.py. The body of each function should generally only require calls to the convert_binary_elementwise utility in the Dynamo directory, with the appropriate operation type.

If a binary operator requires a more complex operation, py/torch_tensorrt/dynamo/conversion/impl/elementwise/ops.py should be modified first.

@github-actions
Copy link

This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days

@gs-olive
Copy link
Collaborator Author

Completed on main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths No Activity Story: ATen Op Support Story: Export/Compile Unification Issues relating to unification of Dynamo compile/export paths
Projects
None yet
Development

No branches or pull requests

3 participants