You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/01/27 09:18:17 UTC

[GitHub] [tvm] huajsj opened a new pull request #10082: [Runtime][PipelineExecutor] Pipeline Executor Sequential execution

huajsj opened a new pull request #10082:
URL: https://github.com/apache/tvm/pull/10082


   In the first, adding the "get output" logic. Secondly, adding the the sequential executing
   logic of pipeline executor. In the last, testing the pipeline executor interface and
   checking the output data.
   
   RFC PR: apache/tvm-rfcs#0014
   GitHub Issue: apache/tvm#8596
   


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] comaniac commented on a change in pull request #10082: [Runtime][PipelineExecutor] Pipeline Executor Sequential execution

Posted by GitBox <gi...@apache.org>.
comaniac commented on a change in pull request #10082:
URL: https://github.com/apache/tvm/pull/10082#discussion_r793847691



##########
File path: python/tvm/contrib/pipeline_executor.py
##########
@@ -203,6 +204,15 @@ def get_input(self, key):
         """
         return self._get_input(key)
 
+    def get_output(self):
+        """Get the output.
+        Returns:
+        -----------

Review comment:
       ```suggestion
           Returns
           -------
   ```

##########
File path: src/runtime/pipeline/pipeline_executor.h
##########
@@ -118,6 +118,17 @@ class TVM_DLL PipelineExecutor : public ModuleNode {
    * \brief Stop the pipeline executor.
    */
   void Stop();
+  /*!
+   * \brief Get a list output data.
+   * \return A list of output data.
+   */
+  Array<NDArray> GetOutput();
+  /*!
+   * \brief A pipeline params with a specific name correspond with the params of a specific
+   *  backend module, this function return the module index for the params name.
+   *  return Return backend runtime module index.

Review comment:
       ```suggestion
      * \param name ...
      * \return Return backend runtime module index.
   ```

##########
File path: src/runtime/pipeline/pipeline_struct.h
##########
@@ -31,14 +31,30 @@
 #include <vector>
 namespace tvm {
 namespace runtime {
+#define GLOBAL_MODULE_INDEX -1
+/*!
+ *\brief The pair includes the module output index and the global output index.
+ * The first 'int' is the module output index, and the second 'int' is the global output index.
+ */
+using GlobalOutputPair = std::pair<int, int>;
+/*!
+ *\brief The pair includes the module index and the module output index.
+ * The first 'int' is the module index, and the second 'int' is the module output index.
+ */
+using ModuleOutputPair = std::pair<int, int>;
 /*!
  * \brief All binding information of a output interface.
  */
 class ConfigBindings {
  public:
   /*!\brief Whether this binding is bound to the PipelineExecutor output interface.*/
   bool IsGlobalOutput() const { return global_output_index_ > -1; }
-
+  /*!\brief Getting the global output index in the current binding.*/
+  int GetGlobalOutputIndex() const { return global_output_index_; }
+  /*!
+   *\brief Returning the binding configuration.
+   */

Review comment:
       ```suggestion
     /*!\brief Returning the binding configuration.*/
   ```

##########
File path: src/runtime/pipeline/pipeline_scheduler.h
##########
@@ -43,10 +43,35 @@ class PipelineScheduler {
    */
   std::vector<std::shared_ptr<BackendRuntime>> PipelineInit(
       const std::vector<Module>& modules, const ConfigPipelineExecution& pipeline_config);
+  /*!
+   * \brief Running the pipeline logic.
+   * \param runtimes A list of backend runtime modules.
+   * \param pipeline_config The dependency configuration of each runtime module.
+   * \param sequential_mode Whether the execution is in a sequential mode.
+   */
+  void PipelineRun(const std::vector<std::shared_ptr<BackendRuntime>>& runtimes,
+                   ConfigPipelineExecution pipeline_config, bool sequential_mode = false);
+  /*!
+   * \brief Running the pipeline logic in the sequential mode.
+   * \param runtimes A list of backend runtime modules.
+   * \param pipeline_config The dependent configuration of each runtime module.
+   */
+  void PipelineRunSequential(const std::vector<std::shared_ptr<BackendRuntime>>& runtimes,
+                             ConfigPipelineExecution pipeline_config);
+  /*!
+   * \brief Stop the pipeline exection.
+   */
+  void PipelineStop();
+  /*!
+   * \brief Get a list of outputs.
+   */
+  Array<NDArray> PipelineGetOutput();
 
  private:
   /*!\brief The list of graph executors.*/
   std::vector<Module> graph_modules_;
+  /*!\brief A list of NDArray used to storage outputs.*/
+  Array<NDArray> output_array_;

Review comment:
       ```suggestion
     Array<NDArray> output_arrays_;
   ```




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] comaniac commented on pull request #10082: [Runtime][PipelineExecutor] Pipeline Executor Sequential execution

Posted by GitBox <gi...@apache.org>.
comaniac commented on pull request #10082:
URL: https://github.com/apache/tvm/pull/10082#issuecomment-1024617361


   Thanks @huajsj 


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] comaniac merged pull request #10082: [Runtime][PipelineExecutor] Pipeline Executor Sequential execution

Posted by GitBox <gi...@apache.org>.
comaniac merged pull request #10082:
URL: https://github.com/apache/tvm/pull/10082


   


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] huajsj commented on pull request #10082: [Runtime][PipelineExecutor] Pipeline Executor Sequential execution

Posted by GitBox <gi...@apache.org>.
huajsj commented on pull request #10082:
URL: https://github.com/apache/tvm/pull/10082#issuecomment-1024582700


   @comaniac , thanks for the fix, all review comments addressed, please take a look.


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org