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

Python buffer API refactoring, RTP Op Wrapper #1818

Merged
merged 17 commits into from
Oct 9, 2024
Merged

Conversation

hunhoffe
Copy link
Collaborator

@hunhoffe hunhoffe commented Oct 3, 2024

This PR cleans up some aspects of using buffers and also RTP writes in conjunction with buffers. Previously, the API could be used something like this (from the ml/bottleneck example):

rtpComputeTile5 = Buffer(ComputeTile5, [16], np.int32, "rtpComputeTile5")
...
NpuWriteRTPOp("rtpComputeTile2", index=0, value=1)  # scale

With the changes, these code snippets become:

rtpComputeTile2 = buffer(ComputeTile2, np.ndarray[(16,), np.dtype[np.int32]], "rtpComputeTile2", use_write_rtp=True)
...
rtpComputeTile2[0] = 1  # scale

I also cleaned up a few examples, for instance replacing a memref.alloc with a buffer and replacing the last lingering objectfifo_release() with the more object-oriented version.

@hunhoffe hunhoffe mentioned this pull request Oct 3, 2024
@hunhoffe hunhoffe changed the title [WIP] Python buffer API refactoring [WIP] Python buffer API refactoring, RTP Op Wrapper Oct 8, 2024
@hunhoffe hunhoffe changed the title [WIP] Python buffer API refactoring, RTP Op Wrapper Python buffer API refactoring, RTP Op Wrapper Oct 9, 2024
@hunhoffe hunhoffe marked this pull request as ready for review October 9, 2024 18:24
@hunhoffe hunhoffe added this pull request to the merge queue Oct 9, 2024
Merged via the queue into main with commit de904d3 Oct 9, 2024
55 checks passed
@hunhoffe hunhoffe deleted the python-buffer-refactor branch October 9, 2024 21:28
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.

2 participants