-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 LL::quotient and remove uses of divideRight and sublayoutIsIdentity #4968
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I know what bug is there?
We also fix a bug in isCrossCTAConversion.
// Is the sublayout defined from dimNames to dimNames the identity? | ||
// In particular, is the input and output size in these dimensions | ||
// the same, and are the bases the identity? | ||
bool squareSublayoutIsIdentity(ArrayRef<StringAttr> dimNames) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, are we ignoring the case where the input dimension names are not equal to the output dimension names, but the input and output are identity mappings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The identity in maths is just defined between a space and itself, so yes, this is the correct mathematical concept. Even if you have registers that map 1-to-1 to a vector of outputs, this would not be an identity map strictly speaking, as it's not mapping elements to themselves, but identifying registers with a matrix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, makes sense then
Previously, we were checking that:
This means that the At the moment I have drawn this rather rough distribution, but it can be optimised in the future. For example, if you just have those two initial conditions, you can still perform the conversion without using distributed shmem, but you'll need to write an indexing that depends on |
Sure, I think it makes sense |
We add a new abstraction `LL::quotient` that abstracts the idea of "a linear layout does not permute certain dimensions". Doing so, allows us to remove `divideRight` and subsume them into this higher-level abstraction. We also fix a bug in `isCrossCTAConversion`. We alsoremove some code duplication from `transferWithinThreads` and `cvtReorderRegisters` in favour of a more generic approach.
We add a new abstraction
LL::quotient
that abstracts the idea of "alinear layout does not permute certain dimensions". Doing so, allows us
to remove
divideRight
and subsume them into this higher-level abstraction.We also fix a bug in
isCrossCTAConversion
.We also remove some code duplication from
transferWithinThreads
andcvtReorderRegisters
in favour of a more generic approach.We fix a bug in
sublayout
that meant thatsublayout
would reorderoutDims
at will by using a set instead of a vector.
I am missing adding tests for LL::quotient, will do in a minute.