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

Channel Example: Sliding Window #704

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

hunhoffe
Copy link
Collaborator

@hunhoffe hunhoffe commented Aug 12, 2024

This is an example of accessing sliding windows of data with channel operations. This example is rudimentary and not ideal because all data must be read in at once. A better example would allow more of a data streaming mechanism, but I'm not sure how best to do that with the current channel API. I think to do this properly you would need some sort of peek() mechanism.

If I don't have the peek() mechanism, if the sliding window is in an scf.for, I believe the only options are to put nested if/else (which I haven't yet ever used, but should be in mlir-python-extras) statements or an scf.index_switch (which is not in mlir-python-extras) with one statement per unique window in the loop... which is not a scalable way to write this sort of code.

I made this example along the way towards working on a large example, and I thought it was a useful building block, so that is why I am adding it to the programming examples (even with the sub-optimal implementation). I'm very open to suggestions for how to make it better!

@hunhoffe hunhoffe marked this pull request as ready for review August 12, 2024 18:43
@hunhoffe hunhoffe requested a review from fifield August 12, 2024 18:43
@hunhoffe hunhoffe mentioned this pull request Aug 12, 2024
11 tasks
@hunhoffe hunhoffe removed the request for review from fifield August 12, 2024 20:30
@hunhoffe hunhoffe marked this pull request as draft August 12, 2024 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant