Skip to content

Commit

Permalink
[WA] Fix test_reduce_layouts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
quintinwang5 authored and whitneywhtsang committed Dec 28, 2024
1 parent 63807b5 commit df900e4
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,18 @@ struct ConvertLayoutOpUsingLinearLayoutsConversion
StringAttr kBlock = str_attr("block");
LinearLayout comp = dstLayout.invertAndCompose(srcLayout);
LinearLayout conversion = *comp.quotient(kBlock)->quotient(kWarp);
int32_t subGroupSize = conversion.getOutDimSize(kLane);

Location loc = op.getLoc();
// FIXME: This workaround addresses the incorrect sgsize and SLM offset in
// ReduceOp and ConvertLayoutOp, which prevents a segmentation fault.
// However, this is a temporary solution. Once the OutDimSize computation
// issue in LinearLayout is resolved, this workaround should be removed.
int32_t subGroupSize = std::min((int32_t)op.getType().getNumElements(),
conversion.getOutDimSize(kLane));
if (!op->hasAttr("allocation.offset")) {
op->setAttr("allocation.offset",
rewriter.getIntegerAttr(rewriter.getI32Type(), 0));
}

SmallVector<Value> inVals =
unpackLLElements(loc, adaptor.getSrc(), rewriter);
Expand Down

0 comments on commit df900e4

Please sign in to comment.