In the demo “vta_get_started.py”, the schedule can be obtained via tvm.lower as following:
Let’s take a look at the generated schedule
s = tvm.create_schedule(C.op)
print(tvm.lower(s, [A, B, C], simple_mode=True))
// attr [A_buf] storage_scope = “global”
allocate A_buf[int32 * 1024]
// attr [B_buf] storage_scope = “global”
allocate B_buf[int32 * 1024]
produce A_buf {
for (i1, 0, 64) {
for (i3, 0, 16) {
A_buf[((i116) + i3)] = A[((i116) + i3)]
}
}
}
produce B_buf {
for (i1, 0, 64) {
for (i3, 0, 16) {
B_buf[((i116) + i3)] = B[((i116) + i3)]
}
}
}
But in this tutorial “deploy_resnet_on_vta.py”, how can get the schedule via vta.build?
# Compile Relay program with AlterOpLayout disabled
with relay.build_config(opt_level=3, disabled_pass={"AlterOpLayout"}):
if target.device_name != "vta":
graph, lib, params = relay.build(
relay_prog, target=target,
params=params, target_host=env.target_host)
else:
with vta.build_config():
graph, lib, params = relay.build(
relay_prog, target=target,
params=params, target_host=env.target_host)