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 tilizing in tt-metal backend #462

Merged
merged 1 commit into from
Aug 23, 2024
Merged

Conversation

rpavlovicTT
Copy link
Contributor

Until now compiler would create single tilize block call with total amount of tiles needed to be generated. LLK actually needs to work on a single row of tiles at the time in order to know how much to stride.

This fix changes lowering to TTMetal dialect and creates correct number of tilize/untilize calls. In between them it pops/pushes from/to given CBs.

With SCF dialect we'll be able to insert loops, but for now these calls will be unrolled.

@rpavlovicTT rpavlovicTT added this to the [Metal Direct 0] milestone Aug 21, 2024
@rpavlovicTT rpavlovicTT self-assigned this Aug 21, 2024
@rpavlovicTT rpavlovicTT requested a review from nsmithtt as a code owner August 21, 2024 13:11
@rpavlovicTT rpavlovicTT force-pushed the rpavlovic/tilizing_fix2 branch from 63396fe to 91b905f Compare August 21, 2024 13:31
Copy link
Contributor

@nsmithtt nsmithtt left a comment

Choose a reason for hiding this comment

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

@rpavlovicTT, good catch and looks great! Once we fix the rank N support let's ship it.

lib/Dialect/TTMetal/Transforms/Passes.cpp Outdated Show resolved Hide resolved
lib/Dialect/TTMetal/Transforms/Passes.cpp Outdated Show resolved Hide resolved
lib/Dialect/TTMetal/Transforms/Passes.cpp Outdated Show resolved Hide resolved
Until now compiler would create single tilize block call with total
amount of tiles needed to be generated. LLK actually needs to work on a
single row of tiles at the time in order to know how much to stride.

This fix changes lowering to TTMetal dialect and creates correct number
of tilize/untilize calls. In between them it pops/pushes from/to given CBs.

With SCF dialect we'll be able to insert loops, but for now these calls
will be unrolled.
@rpavlovicTT rpavlovicTT force-pushed the rpavlovic/tilizing_fix2 branch from 91b905f to 160334c Compare August 22, 2024 09:23
@rpavlovicTT rpavlovicTT merged commit cfff32f into main Aug 23, 2024
7 checks passed
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.

2 participants