Skip to content

Commit 2cd6421

Browse files
yifan.chencharlesxzb
authored andcommitted
fix: PermuteRopeWeightReorderPattern bugfix
- set is_permute_optimize=true if pattern match success Change-Id: I5ce6df99dc6282f3b9cf2c79b8c6066aa74b78ff
1 parent bfe4307 commit 2cd6421

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/Dialect/Tpu/Transforms/ProcessorOptimize/OptimizeBM1684X.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,8 @@ class PermuteRopeWeightReorderPattern
10951095
rope_op.setOperand(2, weight1);
10961096
}
10971097

1098+
rope_op->setAttr("is_permute_optimize", rewriter.getBoolAttr(true));
1099+
10981100
newType = RankedTensorType::get(
10991101
in_shape, module::getElementType(rope_op.getOutput()));
11001102
rope_op.getOutput().setType(newType);
@@ -4794,7 +4796,8 @@ class SelfAttnTileHeadPattern : public OpRewriterPatternEx4<tpu::SoftmaxOp> {
47944796
Value result;
47954797

47964798
if (mm_ctx_tiles > 1 && (multipliers->size() > 1 || rshifts->size() > 1)) {
4797-
llvm::errs() << "not support yet." << "\n";
4799+
llvm::errs() << "not support yet."
4800+
<< "\n";
47984801
return failure();
47994802
}
48004803
for (auto i = 0; i < input_tiles.size(); i++) {
@@ -4935,7 +4938,8 @@ class MatmulTileKPattern : public OpRewriterPatternEx4<tpu::MatMulOp> {
49354938
auto rshifts = module::getI64Array(matMulOp.getRshifts());
49364939
auto multipliers = module::getI64Array(matMulOp.getMultipliers());
49374940
if (multipliers->size() > 1 || rshifts->size() > 1) {
4938-
llvm::errs() << "not support yet." << "\n";
4941+
llvm::errs() << "not support yet."
4942+
<< "\n";
49394943
return failure();
49404944
}
49414945
int tile_len = -1;

0 commit comments

Comments
 (0)