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

[BACKEND] Use the LL API to replace the using of legacy layout attribute API. #5196

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/Dialect/TritonGPU/IR/Dialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3157,10 +3157,6 @@ std::string getDistributedLayoutStr(RankedTensorType tensorType,
if (!layout)
return "";

unsigned threadsPerWarp = getWarpSize(layout);
unsigned numWarpsPerCTA = getNumWarpsPerCTA(layout);
unsigned numBlocks = getNumCTAs(layout);
int numElementsPerThreads = getTotalElemsPerThread(tensorType);
StringAttr kRegister = StringAttr::get(tensorType.getContext(), "register");
StringAttr kLane = StringAttr::get(tensorType.getContext(), "lane");
StringAttr kWarp = StringAttr::get(tensorType.getContext(), "warp");
Expand All @@ -3173,6 +3169,10 @@ std::string getDistributedLayoutStr(RankedTensorType tensorType,
int64_t tensorSize = product(tensorType.getShape());
std::vector<std::string> elementMapping(tensorSize);
std::vector<std::string> threadMapping;
unsigned threadsPerWarp = ll->getInDimSize(kLane);
unsigned numWarpsPerCTA = ll->getInDimSize(kWarp);
unsigned numBlocks = ll->getInDimSize(kBlock);
int numElementsPerThreads = ll->getInDimSize(kRegister);
for (int blockId = 0; blockId < numBlocks; ++blockId) {
for (int warpId = 0; warpId < numWarpsPerCTA; warpId++) {
for (int tid = 0; tid < threadsPerWarp; ++tid) {
Expand Down
Loading