Skip to content

Conversation

@vacu9708
Copy link
Contributor

@vacu9708 vacu9708 commented Jul 9, 2025

Summary

I thought that high-level diagrams of each TVM module would help new contributors make sense of the architecture, lower the barrier to entry, and ultimately speed up development.
Therefore, I've started with visualizing Relax.

Candidate diagrams

I created two diagrams illustrating the same workflow—a block diagram and a UML sequence diagram—and I’d appreciate your feedback on which is more effective.

Block diagram (drawn with draw.io)
relax-block_diagram.drawio.txt
relax-block_diagram

UML sequence diagram (drawn with plantUML)
relax-sequence_diagram.puml.txt
relax-sequence_diagram

In my opinion, the text-based diagram drawn with plantUML would be better for maintainability.

Changes

  • Add a diagram to the document to visually represent interactions between Relax components and their dependencies
  • Fix typos

Since this is my first time uploading images to the docs, please let me know if anything needs adjusting.

@tqchen
Copy link
Member

tqchen commented Jul 9, 2025

usually we don't include the image source in the tree to avoid binary blob, in the past we put image links (see other tutorials) and refer to them.

From the perpsective if overall architecture, I think documenting general philosophy that centeralizes IRModule would help , without going into too much details, like the overall flow image in https://tvm.apache.org/docs/how_to/tutorials/e2e_opt_model.html

This commit fixes typos in the Design and Architecture.
@vacu9708 vacu9708 changed the title [Relax][Doc] Visualize Relax [Doc] Visualize the architecture using a UML sequence diagram Jul 10, 2025
@vacu9708
Copy link
Contributor Author

@tqchen I understand your point that the detailed diagrams for each TVM module are unnecessary.

I’ve now created a more abstract UML sequence diagram that centralizes the IRModule.
Would this help lower the barrier to entry for new contributors?

  • If so, I’ll update the commit for the docs to include it below the "Overall Flow" image.
  • Otherwise, I’ve left only the typo fixes in the commit. Could this commit be merged?

relax-sequence_diagram
relax-sequence_diagram.puml.txt

@tqchen tqchen merged commit 458b0ab into apache:main Jul 10, 2025
11 checks passed
@tqchen
Copy link
Member

tqchen commented Jul 10, 2025

Thanks @vacu9708 , the main issue is that we don't want to focus on a single flow, for example, meta-schedule step can be optional, and we would like to focus on the general setups, e.g. what would the overall flow composition and API related to them looks like. Maybe what we can do first is to give examples of API used wrt to the overall flow figure.

We are in middle of refactoring that hopefully to finalize in next few month, where the architecture roughly will follow the generall overall patterns. At high-level we would like to convey:

also cc @Hzfengsy

@Hzfengsy
Copy link
Member

Thanks @tqchen, I agree that we don't want to focus on a single compilation path. However, it would be good to have documentation for common practice, I think those documents PR should be welcomed by the community

ShiboXing pushed a commit to ShiboXing/tvm that referenced this pull request Aug 10, 2025
…#18128)

[Doc] Fix typos in docs
This commit fixes typos in the Design and Architecture.

Co-authored-by: Youngsik Yang <[email protected]>
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.

3 participants