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 folding for ttir.typecast op #1486

Merged
merged 1 commit into from
Dec 11, 2024
Merged

Add folding for ttir.typecast op #1486

merged 1 commit into from
Dec 11, 2024

Conversation

mmanzoorTT
Copy link
Contributor

No description provided.

Copy link
Contributor

@azecevicTT azecevicTT left a comment

Choose a reason for hiding this comment

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

This looks good.

// CHECK-LABEL: func.func @cast_fold_add
// CHECK-NOT: typecast
// CHECK: ttnn.add
// CHECK-NOT: typecast
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, did you add this second CHECK-NOT to confirm that no typecast will be inserted by some other pass in the pipeline, and even if it gets inserted it will be folded?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added to second CHECK-NOT to verify that we don't have any typecast op in the entire graph (either before or after ttnn.add op). I see your point that it causes more confusion and some other optimization may add another typecast op in future. So I have removed the second CHECK-NOT statement.

@mmanzoorTT mmanzoorTT force-pushed the mmanzoor/typecast-fold branch from 6a2bcaf to 6ee5109 Compare December 11, 2024 16:36
@mmanzoorTT mmanzoorTT force-pushed the mmanzoor/typecast-fold branch from 6ee5109 to 20bed85 Compare December 11, 2024 16:38
@mmanzoorTT mmanzoorTT merged commit 9b398a3 into main Dec 11, 2024
21 checks passed
azecevicTT pushed a commit that referenced this pull request Dec 17, 2024
@mmanzoorTT mmanzoorTT deleted the mmanzoor/typecast-fold branch January 21, 2025 15:22
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.

4 participants