vincentccc opened a new issue, #16288:
URL: https://github.com/apache/tvm/issues/16288
When I deserialize transform_block_layout primitive cause schedule error, I
cannot use gdb to find which line cause this problem, the error message shows
schedule error.
reproduce code:
`import tvm
import tvm.testing
from tvm import tir
from tvm.script import tir as T
from tvm import meta_schedule as ms
import os.path as osp
def _create_tmp_database(
tmpdir: str, mod_eq: str = "structural"
) -> ms.database.JSONDatabase:
path_workload = osp.join(tmpdir, "workloads.json")
path_tuning_record = osp.join(tmpdir, "tuning_records.json")
return ms.database.JSONDatabase(
path_workload, path_tuning_record, module_equality=mod_eq
)
@T.prim_func
def elementwise(
A: T.Buffer((128, 128), "float32"), B: T.Buffer((128, 128), "float32")
) -> None:
for i, j in T.grid(128, 128):
with T.block("B"):
vi, vj = T.axis.remap("SS", [i, j])
B[vi, vj] = A[vi, vj] * 2.0
sch = tir.Schedule(elementwise, debug_mask="all")
block = sch.get_block("B")
sch.transform_block_layout(block, lambda i, j: (i * 128 + j,))
mod = sch.mod
tmpdir = "./transform_logs"
path_workload = tmpdir + "/workloads.json"
path_tuning_record = tmpdir + "/tuning_records.json"
database = _create_tmp_database(tmpdir)
token = database.commit_workload(mod)
trace = sch.trace
records = [
ms.database.TuningRecord(
trace,
token,
[7.0, 8.0, 9.0],
tvm.target.Target("cuda"),
ms.arg_info.ArgInfo.from_prim_func(func=mod["main"]),
)
]
for record in records:
database.commit_tuning_record(record)
database = ms.database.JSONDatabase(
path_workload=path_workload,
path_tuning_record=path_tuning_record,
)
`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]