Hi All,
I used loop_partition primitive for loop:
m,n,k = 32,32,32
a_shape = (m,k)
b_shape = (k,n)
A = te.placeholder(a_shape, "float32", name="A")
B = te.placeholder(b_shape,"float32","B")
k = te.reduce_axis((0,k),"k")
C = te.compute((m,n),lambda i,j: te.sum(A[i,k]*B[k,j],k),"C")
te_func = te.create_prim_func((A, B, C))
MyModule = tvm.IRModule({"main": te_func})
sch = tvm.tir.Schedule(MyModule["main"])
block = sch.get_block("C")
i,j,k = sch.get_loops(block)
sch.loop_partition(i,[4,None])
But if we build the sch.mod
, get some error info:
8: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::SeqStmtNode const*)
at /mnt/ssd/chenf/aone/hhb/src/target/llvm/codegen_llvm.cc:2135
7: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::DeclBufferNode const*)
at /mnt/ssd/chenf/aone/hhb/src/target/llvm/codegen_llvm.cc:2141
6: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::DeclBufferNode const*)
at /mnt/ssd/chenf/aone/hhb/src/target/llvm/codegen_llvm.cc:2141
5: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::DeclBufferNode const*)
at /mnt/ssd/chenf/aone/hhb/src/target/llvm/codegen_llvm.cc:2141
4: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::SeqStmtNode const*)
at /mnt/ssd/chenf/aone/hhb/src/target/llvm/codegen_llvm.cc:2135
3: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AttrStmtNode const*)
at /mnt/ssd/chenf/aone/hhb/src/target/llvm/codegen_cpu.cc:1519
2: tvm::codegen::CodeGenCPU::CreateComputeScope(tvm::tir::AttrStmtNode const*)
at /mnt/ssd/chenf/aone/hhb/src/target/llvm/codegen_cpu.cc:645
1: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::SeqStmtNode const*)
at /mnt/ssd/chenf/aone/hhb/src/target/llvm/codegen_llvm.cc:2135
0: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::ForNode const*)
at /mnt/ssd/chenf/aone/hhb/src/target/llvm/codegen_cpu.cc:1557
File "/mnt/ssd/chenf/aone/hhb/src/target/llvm/codegen_cpu.cc", line 1557
InternalError: Check failed: (is_zero(op->min)) is false:
I have tried to figure out the problems. After partition the loop, the min value of loop var in the tailed-loop is not zero, which results in errors in codegen. Is there any way to solve this problem?
Thanks