[SOLVED][Bug][VTA][PATCH Attached] VTA Load Error After Change VTA Config "LOG_BLOCK_IN" and "LOG_BLOCK_OUT" Into >4 Number


#1

Hi There,

I am doing some practice with VTA Tutorials “Simple Matrix Multiply” and experienced a error issue and it seems like be a bug of vta_conv2d.py.

Issue is after changed LOG_BLOCK_IN and LOG_BLOCK_OUT in vta_config.json into a >4 value like 5, the vta load would report error as following.

Problem seems like caused by resnet18 that used by vta_conv2d.py and have in_filter minimum size which is 16. I attached a patch for such issue which would make “Simple Matrix Multiply” demo work with >4 LOG_BLOCK_IN and LOG_BLOCK_OUT value.

Regards
Hua

Issue:
VTA Load Error After Change VTA Config “LOG_BLOCK_IN” and “LOG_BLOCK_OUT” Into >4 Number.
tvm/vta/python/vta/top/vta_conv2d.py in find_schedules(layer, vt_only, best_only)
151
152 if best_only:
–> 153 return [fil_sched[xfer_size.index(min(xfer_size))]]
154 return fil_sched
155

ValueError: min() arg is an empty sequence

Patch: attached
diff --git a/tvm/vta/python/vta/top/vta_conv2d.py b/tvm/vta/python/vta/top/vta_conv2d.py
index 2b1755d…831b123 100644
— a/tvm/vta/python/vta/top/vta_conv2d.py
+++ b/tvm/vta/python/vta/top/vta_conv2d.py
@@ -149,7 +149,7 @@ def find_schedules(layer, vt_only=False, best_only=False):
fil_sched.append(schedule)
xfer_size.append(_get_data_movement_byte(schedule, layer))

-if best_only:
+if best_only and len(xfer_size):
return [fil_sched[xfer_size.index(min(xfer_size))]]
return fil_sched

@@ -485,5 +485,7 @@ RESNET = {
}

for idx in RESNET:
-scheds = find_schedules(RESNET[idx], vt_only=True, best_only=True)[0]
-WL2PLAN[RESNET[idx]] = scheds
+f_schedule = find_schedules(RESNET[idx], vt_only=True, best_only=True)
+if f_schedule:
+scheds = f_schedule[0]
+_WL2PLAN[RESNET[idx]] = scheds


#2

can you create a PR for this fix, and add me as a reviewer? thanks


#3

@thierry , thanks for the reply, sure, would do that.