-
Notifications
You must be signed in to change notification settings - Fork 94
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
TargetModel in python bindings #1500
Conversation
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! I've been wanting this!
You can't do this. Well you can't do this and not run afoul of the RTTI constraints imposed by IREE and such - namely that there be no RTTI anywhere except the bindings modules. Lest you imagine that that is what you have here, I encourage you to try to build in You also can't do this because you're not actually linking the dialect libs and either getting lucky that the right code ends up in the Much more information here and here. In summary: there's a reason why the PybindTypes stuff is behind a build flag and also the CMake around there is "black magic". EDIT: Indeed the fails are due to missing symbols
|
Is there a better way to do this that you can suggest @makslevental ? |
8adf5af
to
c827a7d
Compare
Jeff got it - you just have to plumb everything through a C API. |
@@ -54,7 +54,7 @@ using TileID = struct TileID { | |||
|
|||
class AIETargetModel { | |||
public: | |||
AIETargetModel() = default; | |||
AIETargetModel(AIEDevice device) : device(device) {} |
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.
I think this is not a good idea... My intention with the TargetModel is that it's a singleton pattern, which is independent of the MLIR. an AIEDevice is the device of a particular design. And a Device is not actually necessary, only a container object that implements the right interface. It's unclear to me why you need to walk from the TargetModel back to a device anyway?
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.
It was convenient for wrapping/unwrapping to keep only the enum around, and this helped with that. https://github.com/Xilinx/mlir-aie/pull/1500/files#diff-3f51e6951752378031f1f22e2616b9d3c77de3a54fcbb31cdc6ab6bd34d109dbR18-R24. But I can probably refactor to avoid the change to TargetModel
I thought it would be useful to query TargetModel from python, for things like L1 size and number of columns.
@makslevental this has some overlap with PybindTypes.cpp used in the python pass stuff, so ultimately maybe there is a better way to do this. But this is one way I found to make it work.