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

[Unity][TVMScript] Register the dispatch for runtime::Module #14337

Closed
wants to merge 1 commit into from

Conversation

sunggg
Copy link
Contributor

@sunggg sunggg commented Mar 20, 2023

This PR registers the dispatch for runtime::Module so that we can print IRModule with BYOC runtime after RunCodegen pass.

cc. @yelite @junrushao

@tvm-bot
Copy link
Collaborator

tvm-bot commented Mar 20, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@Hzfengsy
Copy link
Member

One generic problem: can runtime::Module roundtrip-able print and parse if we printed it as a string? One alternate solution is printed it as metadata.

Love to hear more opinions from the community. cc @junrushao @cyx-6

@junrushao
Copy link
Member

I don't think it's roundtrippable, and additionally, there is no guarantee that it's serializable, which means even if we print it as metadata it's not guaranteed to be parsed back

@tqchen
Copy link
Member

tqchen commented Mar 20, 2023

I think this is something we need to discuss a bit further before taking actions. We should have specific categorizations of runtime modules. Let us followup in community meeting and forums.

At a high level, we can categorize the runtime module properties:

  • binary exportable
  • binary serializable
  • dso exportable
  • runnable

Then we can find ways to be able to serialize the modules that are binary serializable and report error for the rest if we want to have strict serialization.

@junrushao
Copy link
Member

I am not sure if making runtime::Module as roundtrippable as possible is a goal in this particular PR, as it primarily aims to make it "printable" not "parsable" :-)

@sunggg sunggg force-pushed the tvmscript_bugfix branch from 9d64727 to 0ad8af2 Compare March 20, 2023 18:58
@slyubomirsky
Copy link
Contributor

If roundtripping is not intended, we should communicate that clearly, since that would definitely be what users would expect otherwise. (Principle of least surprise.)

@tqchen
Copy link
Member

tqchen commented Mar 31, 2023

I think we can close this for now, following by a more robust solution that detects binary serializable modules and only serialize those(perhaps via base64 encoding)

@tqchen
Copy link
Member

tqchen commented Mar 31, 2023

#14406

@sunggg
Copy link
Contributor Author

sunggg commented Mar 31, 2023

Sounds good to me. Will create the new PR with this change #14406. Thank you all for the review and suggestions!

@sunggg sunggg closed this Mar 31, 2023
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.

6 participants