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

Migrate tt-explorer into tt-mlir repo #945

Merged
merged 6 commits into from
Oct 29, 2024
Merged

Conversation

odjuricicTT
Copy link
Contributor

@odjuricicTT odjuricicTT commented Oct 18, 2024

Add minimal version of tt-explorer tool for MLIR visualization:

  • Only model viewing, no overrides
  • Only able to parse TTIR
  • Basic parsing tests

Next steps:

  • Add TTNN IR parsing
  • Use out fork of UI with overrides
  • Add ability to run the model

Closes #934

Copy link
Contributor

@vprajapati-tt vprajapati-tt left a comment

Choose a reason for hiding this comment

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

As mentioned throughout the code comments, the changes are valid and exciting (bar some cosmetic differences).

My main concern is that I've been working on a pretty major shift into how MLIR will be parsed by tt-adapter to allow for the visualization of TTNN modules. For this reason, I think that if this initial migration isn't too urgent, we could add these changes in from tt-adapter without much conflict. My schedule is to have these changes done over the weekend and ready by Monday. Let me know what you think

tools/explorer/tt_adapter/src/tt_adapter/ttir.py Outdated Show resolved Hide resolved
tools/explorer/tt_adapter/src/tt_adapter/ttir.py Outdated Show resolved Hide resolved
op_to_graph_node = dict()

for op in module.body.operations:
append_later = []
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason we're choosing not to parse the ModuleOps? They would represent the op iter at this level.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It did not seem useful visually.

@odjuricicTT
Copy link
Contributor Author

My main concern is that I've been working on a pretty major shift into how MLIR will be parsed by tt-adapter to allow for the visualization of TTNN modules. For this reason, I think that if this initial migration isn't too urgent, we could add these changes in from tt-adapter without much conflict. My schedule is to have these changes done over the weekend and ready by Monday. Let me know what you think

@vprajapati-tt There is no rush in migrating this over, tho i don't want to keep development going in the other repos for long. I think that it makes sense to wait for you to finish the changes and then figure out what the initial commit will look like.


for operand in op.operands:
if operand.owner == block and operand not in op_to_graph_node:
# This is a constant and we need to create a node for it.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vprajapati-tt While playing with the tool it seemed like it was very useful to have inputs / weights represented as visual nodes as well. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah! This makes sense, I didn't do too much testing with graphs that had weights so this is reasonable.

@odjuricicTT odjuricicTT changed the title Initial commit for tt explorer Migrate tt-explorer into tt-mlir repo Oct 23, 2024
@odjuricicTT odjuricicTT marked this pull request as ready for review October 23, 2024 11:11
@odjuricicTT odjuricicTT force-pushed the odjuricic/explorer-initial branch from 6f58f69 to 18ba484 Compare October 23, 2024 13:26
Copy link
Contributor

@vprajapati-tt vprajapati-tt left a comment

Choose a reason for hiding this comment

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

Changes look good to me! Thanks for all the help with the migration.

@odjuricicTT odjuricicTT force-pushed the odjuricic/explorer-initial branch 2 times, most recently from 1cf8449 to 3b2929b Compare October 29, 2024 08:56
@odjuricicTT
Copy link
Contributor Author

@nsmithtt I think that your review is required as a codeowner. Can you please take a look?

@odjuricicTT odjuricicTT force-pushed the odjuricic/explorer-initial branch from 3b2929b to 6cbb8fa Compare October 29, 2024 08:59
@odjuricicTT odjuricicTT force-pushed the odjuricic/explorer-initial branch from 6cbb8fa to 87ed18f Compare October 29, 2024 15:56
@odjuricicTT odjuricicTT enabled auto-merge (squash) October 29, 2024 15:57
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.

Looks good!

@odjuricicTT odjuricicTT merged commit 9e5509d into main Oct 29, 2024
12 checks passed
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.

Initial transfer of tt-explorer to tt-mlir repo
4 participants