From 1c9e461520a3e7dc9c8753b29a2c39dda9ce1600 Mon Sep 17 00:00:00 2001 From: "Yang Yang(Tony)" Date: Wed, 11 Oct 2017 11:48:39 -0700 Subject: [PATCH] add detailed overview --- doc/design/executor.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/doc/design/executor.md b/doc/design/executor.md index 777f451b1..ab2d6c355 100644 --- a/doc/design/executor.md +++ b/doc/design/executor.md @@ -1,8 +1,26 @@ -# Executor Desgin Doc +# Executor Design Doc + +## Motivation + +We use executor to do the runtime evaluation of a `ProgramDesc`. ## Overview -`Executor` evaluates a `ProgramDesc`. Essentially, it instantializes Variables and Operators, then run all the operators +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 ```c++ void Executor::Run(const ProgramDesc& pdesc, Scope* scope, int block_id) { -- GitLab