Skip to content

[LAYOUTS] Implement divideLeft#6573

Merged
lezcano merged 1 commit intomainfrom
divide_left
Apr 23, 2025
Merged

[LAYOUTS] Implement divideLeft#6573
lezcano merged 1 commit intomainfrom
divide_left

Conversation

@lezcano
Copy link
Copy Markdown
Contributor

@lezcano lezcano commented Apr 23, 2025

Finally got around to implement divideLeft. I rescued and adapted the
divideRight tests from #5170
and added a few more.

As discussed in the inline comment, there is some ambiguity when it
comes to define the quotient if the quotient has dimensions of size one.
You can basically keep them or remove them and both of them would give
you a LinearLayout such that A = B * C. We choose to keep them, as
removing them would make the behaviour too unpredictable. The invariant
here is that the dimensions of the result of leftDivide are the same
as the dimensions of the left input. The right input may have less
dimensions than the right input tho.

Finally got around to implement `divideLeft`. I rescued and adapted the
`divideRight` tests from #5170
and added a few more.

As discussed in the inline comment, there is some ambiguity when it
comes to define the quotient if the quotient has dimensions of size one.
You can basically keep them or remove them and both of them would give
you a LinearLayout such that `A = B * C`. We choose to keep them, as
removing them would make the behaviour too unpredictable. The invariant
here is that the dimensions of the result of `leftDivide` are the same
as the dimensions of the left input. The right input may have less
dimensions than the right input tho.
@lezcano lezcano requested a review from ptillet as a code owner April 23, 2025 12:31
@lezcano lezcano requested review from Jokeren and Mogball April 23, 2025 12:31
@lezcano lezcano merged commit e5e5f57 into main Apr 23, 2025
8 checks passed
@lezcano lezcano deleted the divide_left branch April 23, 2025 13:58
@Mogball
Copy link
Copy Markdown
Collaborator

Mogball commented Apr 23, 2025

Awesome!

FindHao pushed a commit to FindHao/triton that referenced this pull request Apr 30, 2025
Finally got around to implement `divideLeft`. I rescued and adapted the
`divideRight` tests from triton-lang#5170
and added a few more.

As discussed in the inline comment, there is some ambiguity when it
comes to define the quotient if the quotient has dimensions of size one.
You can basically keep them or remove them and both of them would give
you a LinearLayout such that `A = B * C`. We choose to keep them, as
removing them would make the behaviour too unpredictable. The invariant
here is that the dimensions of the result of `leftDivide` are the same
as the dimensions of the left input. The right input may have less
dimensions than the right input tho.
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.

3 participants