tqchen commented on a change in pull request #7918:
URL: https://github.com/apache/tvm/pull/7918#discussion_r620534032
##########
File path: src/runtime/library_module.cc
##########
@@ -143,14 +144,20 @@ runtime::Module ProcessModuleBlob(const char* mblob,
ObjectPtr<Library> lib) {
std::vector<Module> modules;
std::vector<uint64_t> import_tree_row_ptr;
std::vector<uint64_t> import_tree_child_indices;
+ int num_dso_module = 0;
+
for (uint64_t i = 0; i < size; ++i) {
std::string tkey;
ICHECK(stream->Read(&tkey));
// Currently, _lib is for DSOModule, but we
- // don't have loadbinary function for it currently
+ // need to be handled specially
if (tkey == "_lib") {
auto dso_module = Module(make_object<LibraryModuleNode>(lib));
+ *dso_ctx_addr = dso_module.operator->();
+ ++num_dso_module;
modules.emplace_back(dso_module);
+ ICHECK_EQ(num_dso_module, 1U) << "Multiple dso module detected, please
upgrade tvm "
Review comment:
The main problem of warning is that the old behavior have a potential
bug of memory leak, thus encourage re-exporting is better. Most of the old
modules do not have multi-dso module behavior
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]