Skip to content

Commit

Permalink
[OPTIMIZER] Fix crash in loop pipelining. (triton-lang#1602)
Browse files Browse the repository at this point in the history
Fixes issue triton-lang#1601.
  • Loading branch information
bchetioui authored May 2, 2023
1 parent 70cdf21 commit ea02bfc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Dialect/TritonGPU/Transforms/Pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,12 @@ scf::ForOp LoopPipeliner::createNewForOp() {
// we replace the use new load use with a convert layout
size_t i = std::distance(loads.begin(), it);
auto cvtDstTy = op.getResult(0).getType().cast<RankedTensorType>();
auto cvtDstEnc = cvtDstTy.getEncoding().cast<ttg::DotOperandEncodingAttr>();
auto cvtDstEnc =
cvtDstTy.getEncoding().dyn_cast<ttg::DotOperandEncodingAttr>();
if (!cvtDstEnc) {
builder.clone(op, mapping);
continue;
}
auto newDstTy = RankedTensorType::get(
cvtDstTy.getShape(), cvtDstTy.getElementType(),
ttg::DotOperandEncodingAttr::get(
Expand Down

0 comments on commit ea02bfc

Please sign in to comment.