masahi commented on a change in pull request #9108:
URL: https://github.com/apache/tvm/pull/9108#discussion_r719294436



##########
File path: python/tvm/contrib/pipeline_executor.py
##########
@@ -533,11 +570,82 @@ def graph_executor_create(self, pipeline_mods, 
mod_config):
             The Modudle configuration.
         """
 
-        mods = []
-        for pipeline_mod in pipeline_mods:
-            mod = graph_executor.GraphModule(
-                pipeline_mod["default"](pipeline_mods[pipeline_mod]["dev"])
-            )
-            mods.append(mod.module)
+        # Modules need to be stored in the list named 'mods' in index order.
+        mods = [None for _ in range(len(pipeline_mods))]
+        for lib_index in pipeline_mods:
+            pipeline_lib = pipeline_mods[lib_index]["lib"]
+            dev = pipeline_mods[lib_index]["dev"]
+            lib = graph_executor.GraphModule(pipeline_lib["default"](dev))
+            # Return a module list sorted by lib_index.
+            mods[lib_index - 1] = lib.module

Review comment:
       document why subtract 1




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to