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

Enable constraints and runtime measurement for Reshape and Mean Ops #2273

Merged
merged 15 commits into from
Feb 26, 2025

Conversation

arminaleTT
Copy link
Contributor

@arminaleTT arminaleTT commented Feb 24, 2025

Ticket

#2041
#2042

Problem description

To enable llama to go through the optimizer, we need constraints and runtime APIs for all ops (tracked in #2084). This PR enables these APIs for mean and reshape.

What's changed

Note: This PR seems long for a "simple" integration change because both APIs require a manual translation of mlir types down to ttnn types. As a result, opportunities for sharing code across Ops is limited. About 1/3rd of the diff is in unit tests

Checklist

  • New/Existing tests provide coverage for changes

@arminaleTT arminaleTT self-assigned this Feb 25, 2025
@arminaleTT arminaleTT added TTNN Op Perf Model TTNN Constraints&L1 Issues related to compiler-TTNN constraints&L1 interface labels Feb 25, 2025
@arminaleTT arminaleTT marked this pull request as ready for review February 25, 2025 03:19
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Clang-Tidy found issue(s) with the introduced code (1/1)

Copy link
Contributor

@odjuricicTT odjuricicTT left a comment

Choose a reason for hiding this comment

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

Awesome!

Copy link
Contributor

@svuckovicTT svuckovicTT left a comment

Choose a reason for hiding this comment

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

Hey @arminaleTT, it was a pleasure meeting you in Austin!

The change looks good to me, only commentary I have is on the usage of auto - I've linked to our coding guidelines that cover this topic.

@arminaleTT arminaleTT merged commit 9ff6ac1 into main Feb 26, 2025
31 checks passed
@arminaleTT arminaleTT deleted the arminale/op-models branch February 26, 2025 23:44
jserbedzijaTT pushed a commit that referenced this pull request Mar 1, 2025
…2273)

### Ticket
#2041 
#2042 

### Problem description
To enable llama to go through the optimizer, we need constraints and
runtime APIs for all ops (tracked in #2084). This PR enables these APIs
for `mean` and `reshape`.

### What's changed
- Added `getOpRuntime()` and `getOpConstraints()` interface methods to
`ReshapeOp` and `MeanOp`
- Added unit tests for both APIs on both Ops
- Closes #2041 
- Closes #2042

Note: This PR seems long for a "simple" integration change because both
APIs require a manual translation of mlir types down to ttnn types. As a
result, opportunities for sharing code across Ops is limited. About
1/3rd of the diff is in unit tests

### Checklist
- [x] New/Existing tests provide coverage for changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TTNN Constraints&L1 Issues related to compiler-TTNN constraints&L1 interface TTNN Op Perf Model
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement constraints API for ReshapeOp Implement constraints API for MeanOp
3 participants