Skip to content

Commit

Permalink
[BugFix][VTA] Fix vta_conv2d crash issue after change vta_config.json…
Browse files Browse the repository at this point in the history
… configuration. (apache#3213)

Issue:
Once change LOG_BLOCK_IN or LOG_BLOCK_OUT into > 4 value, when run vta
“Simple Matrix Multiply” or load vta, vta would crash at vta_conv2d.py.

Analysis:
This issue caused by resnet18 logic of vta_conv2d.py which have
in_filter minmum size that is 16. > 4 value would cause such in_filter
check failed then make xfer_size be empty and find_schedules function
return a empty list finally cause crash.

Solution:
add the empty list check.
  • Loading branch information
huajsj authored and tmoreau89 committed May 29, 2019
1 parent 7b92c80 commit 302637c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions python/vta/top/vta_conv2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def _get_data_movement_byte(schedule, layer):
fil_sched.append(schedule)
xfer_size.append(_get_data_movement_byte(schedule, layer))

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

Expand Down Expand Up @@ -501,5 +501,10 @@ def __str__(self):
}

for idx in RESNET:
scheds = find_schedules(RESNET[idx], vt_only=True, best_only=True)[0]
_WL2PLAN[RESNET[idx]] = scheds
f_schedules = find_schedules(RESNET[idx], vt_only=True, best_only=True)
if f_schedules:
scheds = f_schedules[0]
_WL2PLAN[RESNET[idx]] = scheds
else:
logging.warning("No valid schedule was found for the workload on current vta configuration")
break

0 comments on commit 302637c

Please sign in to comment.