Skip to content

Commit

Permalink
Add repeat example with L2 stationary weights
Browse files Browse the repository at this point in the history
  • Loading branch information
abisca committed Nov 12, 2024
1 parent e669467 commit 5b86652
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/npu-xrt/objectfifo_repeat/init_values_repeat/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from aie.dialects.aie import *
from aie.dialects.aiex import *
from aie.extras.context import mlir_mod_ctx
from aie.helpers.dialects.ext.scf import _for as range_

N = 4096
dev = AIEDevice.npu1_1col
Expand Down Expand Up @@ -62,11 +63,11 @@ def device_body():
1,
tensor_ty,
initValues=[
np.arange(N, dtype=np.int32),
np.arange(1, N+1, dtype=np.int32),
],
)
of_in.set_repeat_count(memtile_repeat_count)
of_out = object_fifo("out", ComputeTile, ShimTile 1, tensor_ty)
of_out = object_fifo("out", ComputeTile, ShimTile, 1, tensor_ty)

# Compute tile
@core(ComputeTile)
Expand All @@ -76,7 +77,7 @@ def core_body():
elem_in = of_in.acquire(ObjectFifoPort.Consume, 1)
elem_out = of_out.acquire(ObjectFifoPort.Produce, 1)
for i in range_(N):
elem_out[i] = elem_in[i] + 1
elem_out[i] = elem_in[i]
of_out.release(ObjectFifoPort.Produce, 1)
of_in.release(ObjectFifoPort.Consume, 1)

Expand Down

0 comments on commit 5b86652

Please sign in to comment.