comaniac commented on a change in pull request #5919:
URL: https://github.com/apache/incubator-tvm/pull/5919#discussion_r445666228
##########
File path: src/runtime/metadata_module.cc
##########
@@ -48,15 +48,22 @@ class MetadataModuleNode : public ModuleNode {
public:
MetadataModuleNode(const std::unordered_map<std::string, NDArray>& metadata,
const std::unordered_map<std::string,
std::vector<std::string>>& sym_vars)
- : metadata_(metadata), sym_vars_(sym_vars) {}
+ : metadata_(metadata), sym_vars_(sym_vars) {
+ // Only the related submodules are cached to reduce the number of runtime
+ // symbol lookup for initialization. Otherwise, symbols/primitives in the
+ // DSO module will also be cached but they never need to be initialized.
+ for (const auto& it : sym_vars_) {
+ initialized_[it.first] = false;
+ }
+ }
Review comment:
#5926 filed. Will removed these changes after it has been merged.
----------------------------------------------------------------
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]