Skip to content

How to implement sliding window with persistent line buffers using input_buffer in AI Engine? #472

Description

@kimm240

Hello,

I’m working on a stencil-based AI Engine kernel where I want to implement a sliding window using local memory. My goal is to reuse previously loaded rows and update only one row per iteration. Here's the scenario:

Suppose I have 5 rows of data:
ROW 1
ROW 2
ROW 3
ROW 4
ROW 5

In the first iteration, I load ROW 1, ROW 2, ROW 3 into local memory (e.g., using input_buffer).

In the next iteration, I want to load only ROW 4, discard ROW 1, and align memory to now contain ROW 2, ROW 3, ROW 4.

The same logic continues: shift, reuse, update only the latest row.

However, when I use a plio with input_buffer, it seems the entire buffer gets overwritten with new data in each iteration.
This prevents me from preserving previous rows in local memory across iterations.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions