Skip to content

Commit 3ee1d8c

Browse files
fix: bm1688 vit-l multi-core compile
- for arch without l2 Change-Id: I647a829ef4c9c2009738a030aa42f0cfefa4042e
1 parent f399bba commit 3ee1d8c

16 files changed

Lines changed: 28 additions & 21 deletions

lib/Dialect/Tpu/Interfaces/Common/MatMul.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,8 +781,11 @@ bool tpu::MatMulOp::support_multi_core() {
781781

782782
auto out_stype = module::getStorageType(getOutput());
783783
if (out_stype.isF16() || out_stype.isBF16()) {
784-
auto l2_buffer_size = getL2BufferSize();
785784
int64_t l2memSize = backend::BM168x::L2_SRAM_SIZE;
785+
if (l2memSize <= 0) {
786+
return false;
787+
}
788+
auto l2_buffer_size = getL2BufferSize();
786789
auto core_num = module::getCoreNum();
787790
const int MAX_CORES = backend::BM168x::MAX_CORE_NUM;
788791
l2memSize = (l2memSize / MAX_CORES) * core_num;

lib/Dialect/Tpu/Transforms/AddressAssign/BMGlobalBuffer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,10 @@ class MatMulGlobalBuffer : public OpRewriterPatternEx<tpu::MatMulOp> {
526526
return failure();
527527
}
528528

529+
if (backend::BM168x::L2_SRAM_SIZE <= 0) {
530+
return failure();
531+
}
532+
529533
auto buffer_size = matmulOp.getL2BufferSize();
530534
if (buffer_size > 0) {
531535
auto type = ::mlir::Builder(getContext()).getIntegerType(8);

lib/PplBackend/.md5

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1+
correlation_fp.pl c0771f25b7e2d4163b8d7bcd2115886a
2+
interp.cpp 0b99350f1e620ae2c49b7ad6e736387f
3+
selective_scan.cpp 1969832bda37ddc38da0ee4bea00d49b
4+
fattention_tile.cpp 6a2121a7ed7361f83444e9364df4ca18
5+
interp_linear.pl 606aadf79153e4990d87ae8eba16cff1
6+
add_const_fp_local.pl 6ca0ffca1bac1c02f7eb16054d24ea53
7+
add_const_fp.pl 80a5ef9c2d4c8ed8da5383d2e7e94d4e
8+
fattention_api.cpp 538a79df30a022eb089199289597dd53
9+
interp_nearest.pl 640b875b44da1f4f38e1fa6c00fdadb6
10+
add_const_fp_tile.cpp bd7294af08038ccc44c850be959ecd2a
111
fattention_fp16.pl cf99745575ae130e406d8c761a2bb60d
2-
fattention_v2.pl 763c44bab56c4e96afd829beef5e2b3b
12+
fattention_bf16.pl 5ebf0f10543047057be496f2b18593b6
313
correlation.cpp ee21aaadb45df7b2ad6306fc379dc83d
4-
add_const_fp_tile.cpp bd7294af08038ccc44c850be959ecd2a
5-
add_const_fp_local.pl 6ca0ffca1bac1c02f7eb16054d24ea53
614
selective_scan.pl b885de216f85a8c06509429774af6be1
7-
add_const_fp.pl 80a5ef9c2d4c8ed8da5383d2e7e94d4e
8-
fattention_tile.cpp 6a2121a7ed7361f83444e9364df4ca18
9-
interp_linear.pl 81a73b17cad3e06d614df6f47c808e4f
15+
fattention_v2.pl 763c44bab56c4e96afd829beef5e2b3b
1016
add_const_fp_api.cpp be884995098743b144eb446d099cdc7d
11-
fattention_bf16.pl 5ebf0f10543047057be496f2b18593b6
12-
fattention_api.cpp 538a79df30a022eb089199289597dd53
13-
interp_nearest.pl 0b0eeb9ccce762858651a230410bf657
14-
interp.cpp 9cb9dabe364a6f99628e5eeaf052542f
15-
correlation_fp.pl c0771f25b7e2d4163b8d7bcd2115886a
16-
selective_scan.cpp 1969832bda37ddc38da0ee4bea00d49b
1717
dyn_layer_ctrl.c 5fb050e3e6f25101b822bdcb601a9c05
18-
fattention_ctrl.c 613621e1741eebf057a82d3bf0263dab
18+
interp_ctr.c 1e8baa354707862560078ae3fde6740e
1919
add_const_ctrl.c 3d39326082f53e558e11551531b62312
20-
interp_ctr.c c4dd67170cede899d31d53cae13ddfb7
20+
fattention_ctrl.c 613621e1741eebf057a82d3bf0263dab

0 commit comments

Comments
 (0)