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

Add MatmulParams::cluster_dims parameter #3574

Merged
merged 4 commits into from
Dec 11, 2024
Merged

Add MatmulParams::cluster_dims parameter #3574

merged 4 commits into from
Dec 11, 2024

Conversation

jacobhinkle
Copy link
Collaborator

@jacobhinkle jacobhinkle commented Dec 11, 2024

Following #3557 we can specify the cluster size for our fusions. Currently we don't do anything explicitly with CGAs, but this can help guarantee that tiles are scheduled onto GPCs in pairs. Each GPC has a number of TPCs, each of which holds 2 SMs, so this lets us take advantage of caching at the TPC and GPC level for operand loads, in addition to L2.

This PR enables this with a default size of {2, 1, 1} for the Hopper scheduler. The parameter is ignored in the Ampere scheduler.

It is not yet plumbed into the heuristic plugin API yet. I thought maybe we should wait until we have more parameters related to CGAs to do that.

Following #3557 we can specify the cluster size for our fusions.
Currently we don't do anything explicitly with CGAs, but this can help
guarantee that tiles are scheduled onto GPCs in pairs. Each GPC has a
number of TPCs, each of which holds 2 SMs, so this lets us take
advantage of caching at the TPC and GPC level for operand loads, in
addition to L2.
@jacobhinkle
Copy link
Collaborator Author

!test

@jacobhinkle
Copy link
Collaborator Author

!test

@@ -3663,7 +3663,7 @@ TEST_F(HopperMatmulTest, HSH_NT_128BSwizzle) {
const int64_t cta_m = 2 * getM(macro);
const int64_t cta_n = 1 * getN(macro);

constexpr std::tuple<int64_t, int64_t, int64_t> cluster_dims{2, 1, 1};
constexpr std::tuple<int, int, int> cluster_dims{2, 1, 1};
Copy link
Collaborator

Choose a reason for hiding this comment

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

super nitpick: can we stick with int64_t for consistency?

Suggested change
constexpr std::tuple<int, int, int> cluster_dims{2, 1, 1};
constexpr std::tuple<int64_t, int64_t, int64_t> cluster_dims{2, 1, 1};

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I was mostly doing that because the MatmulParams entries are int, but we should probably just change MatmulParams instead (in another PR).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done. Much smaller PR now...

@jacobhinkle
Copy link
Collaborator Author

!build

@jacobhinkle jacobhinkle marked this pull request as ready for review December 11, 2024 18:04
@jacobhinkle jacobhinkle merged commit 4382f28 into main Dec 11, 2024
17 checks passed
@jacobhinkle jacobhinkle deleted the cga_param branch December 11, 2024 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants