Skip to content

Commit

Permalink
[BACKEND] Emit an error when the tensor shape is smaller than the sha…
Browse files Browse the repository at this point in the history
…red memory tile size for shared encoding with leadingOffset=True. (#4731)
  • Loading branch information
Jokeren committed Sep 16, 2024
1 parent a26848c commit f4c48a9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/Dialect/TritonGPU/IR/LinearLayoutConversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,13 @@ LinearLayout sharedToLinearLayoutLeadingOffset(ArrayRef<int64_t> shape,
int tileRows = 8;
int tileCols = 8 * tileWidthBytes / elemBitWidth;

if (shape[colDim] < tileCols || shape[rowDim] < tileRows) {
llvm::errs() << "Illegal shared layout; expected shape to be at least ["
<< tileRows << ", " << tileCols << "], shape: ["
<< shape[rowDim] << ", " << shape[colDim] << "]\n";
llvm::report_fatal_error("Illegal shared layout");
}

int vec = 8 * 16 / elemBitWidth;
if (vec != shared.getVec()) {
llvm::errs() << "Illegal shared layout; expected `vec` to be " << vec
Expand Down

0 comments on commit f4c48a9

Please sign in to comment.