Open stellaraccident opened 5 days ago
Dispatch 86 does trigger the assert in a debug build. Dispatch 88 does not trigger an assert in the debug build (regular MLIR failure).
I think these are the only two issues left in the model (compilation blocking at least). Either can be compiled in isolation with iree-compile --compile-mode=hal-executable
The extra innermost unit dim is causing issues for warp reduction in dispatch 86. It can be fixed via the following:
diff --git a/compiler/src/iree/compiler/Codegen/Common/OptimizeVectorTransferPass.cpp b/compiler/src/iree/compiler/Codegen/Common/OptimizeVectorTransferPass.cpp
index c35d70d99a..7bdf02468c 100644
--- a/compiler/src/iree/compiler/Codegen/Common/OptimizeVectorTransferPass.cpp
+++ b/compiler/src/iree/compiler/Codegen/Common/OptimizeVectorTransferPass.cpp
@@ -13,6 +13,7 @@
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/MemRef/Utils/MemRefUtils.h"
#include "mlir/Dialect/Vector/IR/VectorOps.h"
+#include "mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h"
#include "mlir/Dialect/Vector/Transforms/VectorTransforms.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Pass/Pass.h"
@@ -70,12 +71,14 @@ struct OptimizeVectorTransferPass
// to transfer reads.
{
RewritePatternSet patterns(&getContext());
- mlir::vector::populateCastAwayVectorLeadingOneDimPatterns(patterns);
+ vector::populateCastAwayVectorLeadingOneDimPatterns(patterns);
+ vector::populateDropUnitDimWithShapeCastPatterns(patterns);
vector::ExtractOp::getCanonicalizationPatterns(patterns, &getContext());
+ vector::ShapeCastOp::getCanonicalizationPatterns(patterns, &getContext());
+ vector::BroadcastOp::getCanonicalizationPatterns(patterns, &getContext());
patterns.add<TransposeUnitDimToShapeCast>(&getContext());
- mlir::vector::
- populateVectorTransferCollapseInnerMostContiguousDimsPatterns(
- patterns);
+ vector::populateVectorTransferCollapseInnerMostContiguousDimsPatterns(
+ patterns);
if (failed(applyPatternsAndFoldGreedily(funcOp, std::move(patterns)))) {
return signalPassFailure();
}
For dispatch 88, @bangtianliu can you look into the issue?
sure
The latest int8-model has some compilation issues. If running with a debug compiler, there is an assert:
If running with a release compiler, there are errors on two dispatches.
@main$async_dispatch_86
@main$async_dispatch_88
Probably related.