Skip to content

Question about reduceOp #55

Answered by nhat-nguyen
yuanfz98 asked this question in Q&A
Nov 16, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

You're absolutely right that we can clone the body of tt.reduce to linalg.reduce directly, however this means we won't know what kind of reduce we're dealing with and therefore won't be able to generate the initial reduction values.

Without pattern matching and choosing the correct initial values based on the ops' semantics, we have to use the first elements along the reduction axis and perform the reduction on the remaining elements. However, this results in creatings sub-tensors that aren't always multiple of 2s, which are sub-optimal for certain hardware.

We're planning to propose a change to triton IR so that each reduce op has an enum or tag indicating what kind of reduction the op i…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@nhat-nguyen
Comment options

@yuanfz98
Comment options

Answer selected by yuanfz98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants