We use executor to do the runtime evaluation of a `ProgramDesc`.
## Overview
An executor takes a `ProgramDesc`, a `block_id` and a `Scope`. The `ProgramDesc` is a list of blocks and each block contains the protobuf definition of all the parameters and operators. The `block_id` specifies the entrance block. And the `Scope` is the container of all the variable instance, which is persistent throughout different runs.
### What does executor do?
It evaluates all the operators in the `block_id`th block of a `ProgramDesc`.
### What does executor NOT do?
It does not do runtime optimization, meaning intelligently parse the dependency of each op a choose which one to be run and in which order they should be run.
It does not do graph partitioning, meaning dividing the `ProgramDesc` into several small pieces and executing them on different devices.
## Implementation
`Executor` evaluates a `ProgramDesc`. Essentially, it instantiates Variables and Operators, then run all the operators in sequence. [[code]](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/framework/executor.cc)
<liclass="toctree-l2"><aclass="reference internal"href="../getstarted/build_and_install/index_en.html">Install and Build</a><ul>
<liclass="toctree-l3"><aclass="reference internal"href="../getstarted/build_and_install/docker_install_en.html">PaddlePaddle in Docker Containers</a></li>
<liclass="toctree-l3"><aclass="reference internal"href="../getstarted/build_and_install/build_from_source_en.html">Installing from Sources</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../howto/usage/k8s/k8s_en.html">Paddle On Kubernetes</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../howto/usage/k8s/k8s_aws_en.html">Distributed PaddlePaddle Training on AWS with Kubernetes</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../howto/dev/build_en.html">Build PaddlePaddle from Source Code and Run Unit Test</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../howto/dev/new_layer_en.html">Write New Layers</a></li>
<spanid="executor-design-doc"></span><h1>Executor Design Doc<aclass="headerlink"href="#executor-design-doc"title="Permalink to this headline">¶</a></h1>
<divclass="section"id="motivation">
<spanid="motivation"></span><h2>Motivation<aclass="headerlink"href="#motivation"title="Permalink to this headline">¶</a></h2>
<p>We use executor to do the runtime evaluation of a <codeclass="docutils literal"><spanclass="pre">ProgramDesc</span></code>.</p>
</div>
<divclass="section"id="overview">
<spanid="overview"></span><h2>Overview<aclass="headerlink"href="#overview"title="Permalink to this headline">¶</a></h2>
<p>An executor takes a <codeclass="docutils literal"><spanclass="pre">ProgramDesc</span></code>, a <codeclass="docutils literal"><spanclass="pre">block_id</span></code> and a <codeclass="docutils literal"><spanclass="pre">Scope</span></code>. The <codeclass="docutils literal"><spanclass="pre">ProgramDesc</span></code> is a list of blocks and each block contains the protobuf definition of all the parameters and operators. The <codeclass="docutils literal"><spanclass="pre">block_id</span></code> specifies the entrance block. And the <codeclass="docutils literal"><spanclass="pre">Scope</span></code> is the container of all the variable instance, which is persistent throughout different runs.</p>
<divclass="section"id="what-does-executor-do">
<spanid="what-does-executor-do"></span><h3>What does executor do?<aclass="headerlink"href="#what-does-executor-do"title="Permalink to this headline">¶</a></h3>
<p>It evaluates all the operators in the <codeclass="docutils literal"><spanclass="pre">block_id</span></code>th block of a <codeclass="docutils literal"><spanclass="pre">ProgramDesc</span></code>.</p>
<spanid="what-does-executor-not-do"></span><h3>What does executor NOT do?<aclass="headerlink"href="#what-does-executor-not-do"title="Permalink to this headline">¶</a></h3>
<p>It does not do runtime optimization, meaning intelligently parse the dependency of each op a choose which one to be run and in which order they should be run.</p>
<p>It does not do graph partitioning, meaning dividing the <codeclass="docutils literal"><spanclass="pre">ProgramDesc</span></code> into several small pieces and executing them on different devices.</p>
</div>
</div>
<divclass="section"id="implementation">
<spanid="implementation"></span><h2>Implementation<aclass="headerlink"href="#implementation"title="Permalink to this headline">¶</a></h2>
<p><codeclass="docutils literal"><spanclass="pre">Executor</span></code> evaluates a <codeclass="docutils literal"><spanclass="pre">ProgramDesc</span></code>. Essentially, it instantiates Variables and Operators, then run all the operators in sequence. <aclass="reference external"href="https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/framework/executor.cc">[code]</a></p>
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.
We use executor to do the runtime evaluation of a `ProgramDesc`.
## Overview
An executor takes a `ProgramDesc`, a `block_id` and a `Scope`. The `ProgramDesc` is a list of blocks and each block contains the protobuf definition of all the parameters and operators. The `block_id` specifies the entrance block. And the `Scope` is the container of all the variable instance, which is persistent throughout different runs.
### What does executor do?
It evaluates all the operators in the `block_id`th block of a `ProgramDesc`.
### What does executor NOT do?
It does not do runtime optimization, meaning intelligently parse the dependency of each op a choose which one to be run and in which order they should be run.
It does not do graph partitioning, meaning dividing the `ProgramDesc` into several small pieces and executing them on different devices.
## Implementation
`Executor` evaluates a `ProgramDesc`. Essentially, it instantiates Variables and Operators, then run all the operators in sequence. [[code]](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/framework/executor.cc)
<p>An executor takes a <codeclass="docutils literal"><spanclass="pre">ProgramDesc</span></code>, a <codeclass="docutils literal"><spanclass="pre">block_id</span></code> and a <codeclass="docutils literal"><spanclass="pre">Scope</span></code>. The <codeclass="docutils literal"><spanclass="pre">ProgramDesc</span></code> is a list of blocks and each block contains the protobuf definition of all the parameters and operators. The <codeclass="docutils literal"><spanclass="pre">block_id</span></code> specifies the entrance block. And the <codeclass="docutils literal"><spanclass="pre">Scope</span></code> is the container of all the variable instance, which is persistent throughout different runs.</p>
<divclass="section"id="what-does-executor-do">
<spanid="what-does-executor-do"></span><h3>What does executor do?<aclass="headerlink"href="#what-does-executor-do"title="永久链接至标题">¶</a></h3>
<p>It evaluates all the operators in the <codeclass="docutils literal"><spanclass="pre">block_id</span></code>th block of a <codeclass="docutils literal"><spanclass="pre">ProgramDesc</span></code>.</p>
<spanid="what-does-executor-not-do"></span><h3>What does executor NOT do?<aclass="headerlink"href="#what-does-executor-not-do"title="永久链接至标题">¶</a></h3>
<p>It does not do runtime optimization, meaning intelligently parse the dependency of each op a choose which one to be run and in which order they should be run.</p>
<p>It does not do graph partitioning, meaning dividing the <codeclass="docutils literal"><spanclass="pre">ProgramDesc</span></code> into several small pieces and executing them on different devices.</p>
<p><codeclass="docutils literal"><spanclass="pre">Executor</span></code> evaluates a <codeclass="docutils literal"><spanclass="pre">ProgramDesc</span></code>. Essentially, it instantiates Variables and Operators, then run all the operators in sequence. <aclass="reference external"href="https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/framework/executor.cc">[code]</a></p>
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.