[TVMScript] fail to print predicate info of BufferLoad,BufferStore

复现代码见:ScriptPrinter PROBLEM · GitHub

向量有尾巴不整除的时候,BufferLoad有predicate信息,但script()/show()方法没显示出来,应该如何添加方法来打印信息呢?

Thanks for the feedback. I cannot reproduce your behavior in the latest codebase, here is the result from my end

@I.ir_module
class Module:
    @T.prim_func
    def main(A: T.Buffer((35,), "float32"), B: T.Buffer((35,), "float32")):
        T.func_attr(
            {
                "from_legacy_te_schedule": T.bool(True),
                "global_symbol": "main",
                "tir.noalias": T.bool(True),
            }
        )
        for i_outer in range(4):
            cse_var_1: T.int32 = i_outer * 8
            B[cse_var_1 : cse_var_1 + 8] = A[cse_var_1 : cse_var_1 + 8] + T.Broadcast(
                T.float32(3), 8
            )
        B[32:35] = A[32:35] + T.Broadcast(T.float32(3), 3)
#[version = "0.0.5"]
@main = primfn(A_1: handle, B_1: handle) -> ()
  attr = {"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True}
  buffers = {A: Buffer(A_2: Pointer(float32), float32, [35], []),
             B: Buffer(B_2: Pointer(float32), float32, [35], [])}
  buffer_map = {A_1: A, B_1: B} {
  for (i.outer: int32, 0, 4) {
    let cse_var_1: int32 = (i.outer*8)
    B[ramp(cse_var_1, 1, 8)] = (A[ramp(cse_var_1, 1, 8)] + broadcast(3f32, 8))
  }
  B[ramp(32, 1, 3)] = (A[ramp(32, 1, 3)] + broadcast(3f32, 3))
}

BTW, BufferLoad and BufferStore does not have the predicate field. I wonder your TVM version, and please update to the lateset one if possible :slight_smile:

1 Like

Thanks, problem solved with lastest tvm version.