Skip to content

[RUNTIME] Correctly handling export_module when exporting modules of different type#13489

Merged
tqchen merged 7 commits intoapache:mainfrom
jinhongyii:fix-export-module
Nov 27, 2022
Merged

[RUNTIME] Correctly handling export_module when exporting modules of different type#13489
tqchen merged 7 commits intoapache:mainfrom
jinhongyii:fix-export-module

Conversation

@jinhongyii
Copy link
Copy Markdown
Contributor

Previously the export_module function assumes that the module and all imported modules have the same type_key. If we have a host llvm module and some imported c modules, it may fail to set the llvm_target_string and object_format correctly, and thus fail to continue with the llvm build flow.

In this PR, I set the object format of a mixed-type module to that of the host module, and always set llvm_target_string when we see a host llvm module.

cc: @tqchen @YuchenJin

@tvm-bot
Copy link
Copy Markdown
Collaborator

tvm-bot commented Nov 26, 2022

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

@tqchen
Copy link
Copy Markdown
Member

tqchen commented Nov 26, 2022

Thanks hongyi. This is a hidden issue as previous behavior will still go through the c export route, and not the llvm one. Which is still correct for small module size. But it will cost long export time for bigger models. cc @jwfromm

Comment thread tests/python/unittest/test_runtime_module_export.py Outdated
@tqchen tqchen merged commit 61a4f21 into apache:main Nov 27, 2022
gigiblender pushed a commit to gigiblender/tvm that referenced this pull request Jan 19, 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.

3 participants