-
Notifications
You must be signed in to change notification settings - Fork 86
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
Configure AIE using control packets #1728
Conversation
npu_maskwrite32(addr, value, mask) | ||
else: | ||
raise Exception(f"Unhandled op: {op:#x}") | ||
if mlir_ctrl_pkt: |
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.
This is a nice quick way to get a proof of concept but I think npu op to control packet conversion should be an mlir pass in C++ if it is going to be supported in mlir-aie. Converting runtime sequence mlir to a binary blob then to control packet mlir is a bit hacky.
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.
Totally agreed. I'm thinking that perhaps ideally there should be an mlir pass that converts write32/blockwrite/maskedwrite32 ops into control packet ops, and another pass that converts control packet ops to dma_memcpy_nd ops represeting shim dma issuing control packet writes to tiles. Let me create an issue to extend this discussion.
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.
Sounds good. This txn2mlir.py script is mostly intended to be a disassembler and debugging aid. It is not intended to be load bearing.
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.
Issue created: #1729
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.
related to #1740
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.
This should wait for #1709 to land. That one is still a draft because it lacks proper tests.
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.
Ideally this file should be generated as part of the test
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.
Agreed. Locally this file is generated by mlir passes. Let me create a separate PR for those passes that I'm working on locally.
Agreed. Will rebase after that one lands on main with more tests. |
txn2mlir.py
can now generate control packet ops that work.