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

[LLVMGPU] Prefer column major MFMA to vectorize stores #19919

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

qedawkins
Copy link
Contributor

The layout of MFMA ops allows producing a column major result without
changing the inputs. Because the layout of all MFMA results vectorize
along the column, this is always better unless we are already trying to
store transposed.

depends on #19860

For MMA intrinsics with symmetric register layouts we have the freedom
to choose between row major and column major output layouts by simply
swapping the input operands. This adds a flag to `MMAAttr` that allows
specifying whether the result should be column major.

A follow up PR will turn the column major variant on by default for
mfma as this enables vectorization of writes in non-transpose cases.
The layout of MFMA ops allows producing a column major result without
changing the inputs. Because the layout of all MFMA results vectorize
along the column, this is always better unless we are already trying to
store transposed.
@@ -172,12 +173,40 @@ static std::optional<GPUMMASchedule> getMmaScheduleFromProblemAndTarget(
return schedule;
}

/// A coarse approximation of when the given value |v| is consumed column
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this "coarseness" be refined into something more precise in any useful way?

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