Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VTA] Hotfix for padded load test in Chisel VTA #4264

Merged
merged 2 commits into from
Nov 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions vta/hardware/chisel/src/main/scala/core/TensorUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ class TensorDataCtrl(tensorType: String = "none",
when(split) {
caddr := caddr + xmax_bytes
}.elsewhen(stride) {
caddr := baddr + (dec.xstride << log2Ceil(strideFactor))
baddr := baddr + (dec.xstride << log2Ceil(strideFactor))
caddr := baddr + (dec.xstride << log2Ceil(elemBytes))
baddr := baddr + (dec.xstride << log2Ceil(elemBytes))
}
}

Expand Down
10 changes: 5 additions & 5 deletions vta/tests/python/unittest/test_vta_insn.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ def test_padded_load():
"""Test padded load."""
def _run(env, remote):
# declare
n = 21
m = 20
pad_before = [0, 1, 0, 0]
pad_after = [1, 3, 0, 0]
n = 3
m = 5
pad_before = [2, 1, 0, 0]
pad_after = [1, 2, 0, 0]
x = tvm.placeholder(
(n, m, env.BATCH, env.BLOCK_OUT),
name="x",
Expand Down Expand Up @@ -126,7 +126,7 @@ def _run(env, remote):
f = remote.load_module("padded_load.o")
# verify
ctx = remote.ext_dev(0)
x_np = np.random.randint(1, 2, size=(
x_np = np.random.randint(-10, 10, size=(
n, m, env.BATCH, env.BLOCK_OUT)).astype(x.dtype)
y_np = np.zeros((n + pad_before[0] + pad_after[0],
m + pad_before[1] + pad_after[1],
Expand Down