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

Fix reciprocal op in TVM relay PyTorch frontend #245

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

chandrasekaranpradeep
Copy link
Contributor

Fixes #112

  1. In TVM pytorch frontend conversion, the aten::reciprocal is mapped to divide op.
Screenshot 2024-09-09 at 12 41 27 PM
  1. In TVM forge passes, we have decomposed divide op into reciprocal and multiply.
Screenshot 2024-09-09 at 12 41 41 PM
  1. Below is the initial graph for single reciprocal in Forge
Screenshot 2024-09-09 at 12 36 49 PM

In the intial graph, we doesn't need the multplication of reciprocal output with ones constant tensor which was instroduced from TVM. So mapped aten::reciprocal with tvm.relay.reciprocal directly

  1. Intial graph after mapping aten::reciprocal with tvm.relay.reciprocal directly.
Screenshot 2024-09-09 at 12 37 17 PM

@nvukobratTT
Copy link
Contributor

Can you map TVM change as well? :))

@chandrasekaranpradeep
Copy link
Contributor Author

Can you map TVM change as well? :))

@nvukobratTT TVM PR: tenstorrent/tt-tvm#28

Copy link
Contributor

@nvukobratTT nvukobratTT left a comment

Choose a reason for hiding this comment

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

LGTM. Just a reminder to update a TVM side once merged.

@chandrasekaranpradeep
Copy link
Contributor Author

chandrasekaranpradeep commented Sep 9, 2024

@nvukobratTT The test cases are failed, because in some pytest they are using pyforge instead of forge, I will rename it

@chandrasekaranpradeep chandrasekaranpradeep force-pushed the pchandrasekaran/reciprocal branch 2 times, most recently from 36bdc4a to 994ca9d Compare September 10, 2024 02:37
@chandrasekaranpradeep chandrasekaranpradeep merged commit b7a17e6 into main Sep 10, 2024
3 checks passed
@chandrasekaranpradeep chandrasekaranpradeep deleted the pchandrasekaran/reciprocal branch September 10, 2024 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Ops] Support for reciprocal op (ttnn.reciprocal)
2 participants