You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MatmulTest.TestF32ConstantWeights test is failing on arm64 linux platform with openxla mainline code. From the HLO passes and matmul contraction rewriter logic analysis, it looks like the behavior is as expected and the test app need to be fixed. Following is my analysis:
The failure is due to the mismatch between the expected and the resulted custom-call signature; the weights argument (arg1) is expected to come as a constant literal but it was written as broadcast. The broadcast arg seem to be correct in this case.
expected signature is:
The Analysis shows that, though onednn contraction rewriter adds constant literal for weights after they are pre-packed, the additional HLO passes, in this case, the algsimp, detected that all the values in the literal are the same, so the following HLO pass replaces const with broadcast.
// If a literal is all the same element replace it with a scalar broadcast.
if (ShapeUtil::ElementsIn(constant->shape()) > 1 &&
constant->literal().IsAllFirst()) {
std::cout << "AlgebraicSimplifierVisitor::HandleConstant3" << std::endl;
Literal unique_scalar(
LiteralUtil::GetFirstScalarLiteral(constant->literal()));
HloInstruction* scalar = constant->AddInstruction(
simplifier_->CreateConstantWithLayoutUpdated(std::move(unique_scalar)));
return ReplaceWithNewInstruction(
constant,
HloInstruction::CreateBroadcast(constant->shape(), scalar, {}));
}
MatmulTest.TestF32ConstantWeights test is failing on arm64 linux platform with openxla mainline code. From the HLO passes and matmul contraction rewriter logic analysis, it looks like the behavior is as expected and the test app need to be fixed. Following is my analysis:
The failure is due to the mismatch between the expected and the resulted custom-call signature; the weights argument (
arg1
) is expected to come as aconstant
literal but it was written asbroadcast
. Thebroadcast
arg seem to be correct in this case.expected signature is:
and the rewritten and then simplified custom-call signature is:
The Analysis shows that, though onednn contraction rewriter adds
constant
literal for weights after they are pre-packed, the additional HLO passes, in this case, thealgsimp
, detected that all the values in the literal are the same, so the following HLO pass replacesconst
withbroadcast
.file: https://github.com/openxla/xla/blob/main/xla/hlo/transforms/simplifiers/algebraic_simplifier.cc#L2059
Here is the test case:
https://github.com/openxla/xla/blob/main/xla/service/cpu/tests/onednn_matmul_test.cc#L997
The text was updated successfully, but these errors were encountered: