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

[PROTON-DEV] protongpu shared memory buffer conversion pass #6029

Merged
merged 4 commits into from
Feb 27, 2025

Conversation

fywkevin
Copy link
Contributor

In this PR, we add the support for proton's internal SMEM profiling buffer conversion. This pass happens after proton-to-protongpu lowering and after the general triton's shared-memory-alloc pass. We basically override the ttg.shared attributes and annotate the shared memory alloc op proton inserted.

@fywkevin fywkevin requested review from Jokeren and CRobeck February 26, 2025 18:58
@fywkevin fywkevin requested a review from ptillet as a code owner February 26, 2025 18:58
// Compute the proton buffer size in bytes.
auto memDescTy =
mlir::cast<triton::gpu::MemDescType>(alloc.getResult().getType());
int bufferSizeInBytes = memDescTy.getShape()[0] * 4;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use getNumElements? just for generality.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. You mean a helper function? The shape is an ArrayRef not a RankedTensorType.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think memDescTy has a getNumElements method. Correct me if I were wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see what you are saying. You are referring to mlir::ShapedType::getNumElements.

Done.

@Jokeren Jokeren merged commit e770cb1 into triton-lang:proton-dev Feb 27, 2025
7 checks passed
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