-
Notifications
You must be signed in to change notification settings - Fork 23
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
[Experimental][Buffers] A simple pass for inserting a single buffer at a specific channel #62
Conversation
output of a unit This pass facilitates prototyping a custom buffer placement analysis externally, e.g., in python, for example, we can add a buffer by specifying the follows: dynamatic-opt handshake_transformed.mlir \ --handshake-placebuffers-custom="pred=mux2 outid=0 slots=5 type=oehb" \ --handshake-placebuffers-custom="pred=mux2 outid=0 slots=5 type=tehb" \
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the contibution :) I think that could be very useful to other Dynamatic developers! I left a couple of minor comments.
For example, we can add a buffer by specifying the following
The convention I have followed so far when having to refer to a specific value use (i.e., channel) externally is by a combination of the consumer's name and operand index (instead of by a combination of producer's name and result index). Different uses of the same SSA value will always have a different consumer or operand index hence the former has the advantage of working even when the IR is not materialized. Since you check that the IR is materialized as a pass pre-condition and that I don't think it makes sense to deal with buffers on unmaterialized IR anyway I am fine leaving this as is, just mentioning it for future work.
At some point I think it would make sense to provide a generic way to insert semi-arbitrary operations in the IR at semi-arbitrary points (by expressing their connections with surrounding operations) to support the kind of workflow you describe in more situations.
experimental/include/experimental/Transforms/HandshakePlaceBuffersCustom.h
Outdated
Show resolved
Hide resolved
experimental/include/experimental/Transforms/HandshakePlaceBuffersCustom.h
Outdated
Show resolved
Hide resolved
2ab3322
to
0745f09
Compare
HandshakePlaceBuffersCustomPass.
…lir into placebuffers-custom
Thanks for the comments! I have updated PR accordingly:) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for the contribution :)
This pass facilitates externally prototyping a custom buffer placement analysis, e.g., in Python. This also makes the results of some research artifacts (e.g., Mapbuf) developed in Python easily reproducible in the current Dynamatic framework.
A typical workflow would be:
handshake_transformed.mlir
to DOT, apply some external analysis using Python to determine where to place buffers.handshake_buffered.mlir
.For example, we can add a buffer by specifying the following (this is for the benchmark
fir
):Any suggestions?