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

Convert aten.alias to no-op #223

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Convert aten.alias to no-op #223

wants to merge 1 commit into from

Conversation

jerrysky3
Copy link
Collaborator

Ticket

No

Problem description

Convert aten.alias to no-op

What's changed

  • Replace aten.alias with its input (no-op)
  • Add test cases

@jerrysky3 jerrysky3 marked this pull request as ready for review September 19, 2024 02:57
Copy link
Collaborator

@jdh8 jdh8 left a comment

Choose a reason for hiding this comment

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

I verified this changeset with pytest tests/lowering/, but I could not pytest tests/models/ due to insufficient disk space.

@@ -312,6 +312,10 @@ def call_function(self, target, args, kwargs):
return self.call_function_prop_meta(ttnn.squeeze, args, kwargs)
return self.call_function_prop_meta(target, args, kwargs)

if target == torch.ops.aten.alias.default:
# alias is no-op
return args[0]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Amazing discovery! Since directly returning an argument is a valid conversion, this can lead to several simplifications:

  • We can refactor manual conversions to simple conversions, e.g. aten.arange.*ttnn.arange.
  • Perhaps we can optimize out aten.clone like aten.alias.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants