Skip to content

[TritonGEN] Use the sub-group-size of the module instead of hard code number of 16 in block load. #4764

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

Merged
merged 3 commits into from
Jul 24, 2025

Conversation

chengjunlu
Copy link
Contributor

[TritonGEN] Use the sub-group-size of the module instead of hard code number of 16 in block load.

@chengjunlu chengjunlu force-pushed the chengjun/tritongen_block_load_subgroupsize_32 branch from d865d15 to 56255da Compare July 22, 2025 07:37
… number of 16 in block load.

Signed-off-by: Lu,Chengjun <[email protected]>
@@ -238,7 +240,8 @@ verify2DBlockLoadHWRestriction(TritonGEN::Matrix2DBlockLoadOp op) {
VectorType resTy = op.getRes().getType();
unsigned resElemTySize = resTy.getElementType().getIntOrFloatBitWidth();
unsigned resSize = resTy.getNumElements() * resElemTySize;
constexpr unsigned subgroupSize = 16;
unsigned subgroupSize = triton::gpu::TritonGPUDialect::getThreadsPerWarp(
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure we want to add a TritonGPU dependency to TritonGEN dialect.
Two alternative solutions I could think of are

  1. revert f0eed6f, and use the SPV target env.
  2. Assuming subgroupSize to be either 16 or 32, and only emit error if both are not satisfied.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see that we have already added the dependency in a earlier PR, so we can continue this approach, and reconsider the alternatives after this PR if preferred.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. We can clean up the dependency later in cleaning up.

@chengjunlu
Copy link
Contributor Author

Let's land this change first.

@chengjunlu chengjunlu merged commit 92b6a32 into main Jul 24, 2025
15 checks passed
@chengjunlu chengjunlu deleted the chengjun/tritongen_block_load_subgroupsize_32 branch July 24, 2025 03:18
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