Skip to content

Commit 9d64b33

Browse files
[AMD] Fix matmul unit test failure on RDNA4 (#7631)
This PR fixes language/test_matmul.py::test_simple_matmul failures for fp64 on RDNA4. There were 4 failing test cases of the form test_matmul.py::test_simple_matmul[float64 - float64], These failures were specific to the RDNA4 backend and are now resolved by this PR.
1 parent 8dd7ccb commit 9d64b33

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

third_party/amd/lib/TritonAMDGPUToLLVM/DotOpToLLVM/FMA.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ class AMDFMAVectorMultiplier : public FMAVectorMultiplier {
6060
dElemTy);
6161
chosenOp.vectorSize = 1;
6262
chosenOp.outElemTy = aElemTy;
63+
if (aElemTy.isF64())
64+
chosenOp.intrinsicName = "llvm.fmuladd.f64";
6365
if (aElemTy.isF32())
6466
chosenOp.intrinsicName = "llvm.fmuladd.f32";
6567
if (aElemTy.isF16())

third_party/amd/lib/TritonAMDGPUTransforms/AccelerateAMDMatmul.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,7 @@ class AccelerateBlocked : public OpRewritePattern<DotOp> {
11941194
auto elTy = opTy.getElementType();
11951195
if (elTy != expectedElTy)
11961196
return false;
1197-
if (!elTy.isF16() && !elTy.isF32())
1197+
if (!elTy.isF16() && !elTy.isF32() && !elTy.isF64())
11981198
return false;
11991199
}
12001200
return true;

0 commit comments

Comments
 (0)