File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
third_party/intel/lib/TritonIntelGPUToLLVM Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -584,9 +584,18 @@ struct ConvertLayoutOpUsingLinearLayoutsConversion
584584 StringAttr kBlock = str_attr (" block" );
585585 LinearLayout comp = dstLayout.invertAndCompose (srcLayout);
586586 LinearLayout conversion = *comp.quotient (kBlock )->quotient (kWarp );
587- int32_t subGroupSize = conversion.getOutDimSize (kLane );
588587
589588 Location loc = op.getLoc ();
589+ // FIXME: This workaround addresses the incorrect sgsize and SLM offset in
590+ // ReduceOp and ConvertLayoutOp, which prevents a segmentation fault.
591+ // However, this is a temporary solution. Once the OutDimSize computation
592+ // issue in LinearLayout is resolved, this workaround should be removed.
593+ int32_t subGroupSize = std::min ((int32_t )op.getType ().getNumElements (),
594+ conversion.getOutDimSize (kLane ));
595+ if (!op->hasAttr (" allocation.offset" )) {
596+ op->setAttr (" allocation.offset" ,
597+ rewriter.getIntegerAttr (rewriter.getI32Type (), 0 ));
598+ }
590599
591600 SmallVector<Value> inVals =
592601 unpackLLElements (loc, adaptor.getSrc (), rewriter);
You can’t perform that action at this time.
0 commit comments