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

Added maybe_downcast & hardened TT Attrs and Types to include better support #1253

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

vprajapati-tt
Copy link
Contributor

  • Manually defined downcasting methods. Goal is to autogenerate these, should be decently easy to integrate with tblgen for the cpp methods, but difficult to throw into the pybind declaration itself. Was easier to do a short sighted fix where these methods are manually defined.
  • Used dyn_cast instead of cast for a safer call signature. Failure will be defined through the function resulting in None instead of a full failure.

@nsmithtt
Copy link
Contributor

Vraj is this PR still relevant in light of the pybind macros we just discovered?

@vprajapati-tt
Copy link
Contributor Author

vprajapati-tt commented Nov 14, 2024

Unfortunately no, my task for tomorrow is to refactor the python bindings to adopt this newer structure. I will close this PR and make a new one when that's ready. There are parts of this PR (the extended support for Attrs and Types in the TT, TTNN dialects) that will be transferred over to this new PR though.

@vprajapati-tt
Copy link
Contributor Author

@nsmithtt This PR is now relevant again 🎊. Feel free to review when available

Copy link
Contributor

@nsmithtt nsmithtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, lgtm!

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.

Implement maybe_downcast for TTMLIR Python Bindings
2 participants