Skip to content

Commit

Permalink
[BACKEND] Fix workaround for unsupported cases in maybeDeduplicate (t…
Browse files Browse the repository at this point in the history
…riton-lang#4048)

The logic of maybeDeduplicate doesn't seem to handle nv mma layouts. Fix
the check we have to prevent it to be used for layouts that are nv mma
or sliced of nv mma
  • Loading branch information
ThomasRaoux authored and bertmaher committed Dec 4, 2024
1 parent c082849 commit 9583a6f
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ class ElementwiseOpConversionBase : public ConvertOpToLLVMPattern<SourceOp> {
if (!encoding)
// encoding not available
return resultVals;
if (!dyn_cast<BlockedEncodingAttr>(encoding) &&
!dyn_cast<SliceEncodingAttr>(encoding)) {
// TODO: constraining the ecndoing type here is necessary for avoiding
// crashes in the getElemsPerThread call below happening in the
Attribute baseEncoding = encoding;
while (auto sliced = dyn_cast<SliceEncodingAttr>(baseEncoding))
baseEncoding = sliced.getParent();
if (isa<NvidiaMmaEncodingAttr, DotOperandEncodingAttr>(baseEncoding)) {
// TODO: this logic seems incorrect for mma layout. Skip for now.
// The following test crashes and some other miscompile:
// test_core::test_fp8_dot_acc
return resultVals;
}
Expand Down

0 comments on commit 9583a6f

Please sign in to comment.