tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] zhiics commented on a change in pull request #5770: [BYOC][runtime] Separate code and metadata for CSourceModule
Date Mon, 15 Jun 2020 15:38:17 GMT

zhiics commented on a change in pull request #5770:
URL: https://github.com/apache/incubator-tvm/pull/5770#discussion_r440266641



##########
File path: python/tvm/runtime/module.py
##########
@@ -222,21 +222,29 @@ def evaluator(*args):
         except NameError:
             raise NameError("time_evaluate is only supported when RPC is enabled")
 
-    def _collect_dso_modules(self):
-        """Helper function to collect dso modules, then return it."""
-        visited, stack, dso_modules = set(), [], []
+    def _collect_dso_metadata_modules(self):
+        """
+        Helper function to collect dso modules and metadata init module. There
+        is at most one medata init module if it exists.
+        """
+        visited, stack, dso_modules, metadata_init = set(), [], [], None
         # append root module
         visited.add(self)
         stack.append(self)
         while stack:
             module = stack.pop()
             if module._dso_exportable():
                 dso_modules.append(module)
+            elif module.type_key == "module_init":
+                assert not metadata_init, \
+                        "At most one module initializer is allowed"

Review comment:
       The python side changes will be all removed.




----------------------------------------------------------------
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:
users@infra.apache.org



Mime
View raw message