Skip to content

Commit

Permalink
[AMD] Skip mfma layout in maybeDuplicate (triton-lang#4170)
Browse files Browse the repository at this point in the history
The workaround introduced in
triton-lang#4048 "forgot" to skip mfma
layout.
  • Loading branch information
zhanglx13 authored and bertmaher committed Dec 4, 2024
1 parent 23363e2 commit 7d3f8b8
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ class ElementwiseOpConversionBase : public ConvertOpToLLVMPattern<SourceOp> {
// encoding not available
return resultVals;
Attribute baseEncoding = encoding;
if (isa<AMDMfmaEncodingAttr>(baseEncoding))
// TODO: this logic seems incorrect for mfma layout. Skip for now.
// We saw mismatches for some flash-attention tests on AMD backend.
// Note that this logic works for sliced layout whose parent is
// mfma layout. Therefore, this is not combined with the following check.
return resultVals;
while (auto sliced = dyn_cast<SliceEncodingAttr>(baseEncoding))
baseEncoding = sliced.getParent();
if (isa<NvidiaMmaEncodingAttr, DotOperandEncodingAttr>(baseEncoding)) {
Expand Down

0 comments on commit 7d3f8b8

Please sign in to comment.