ONE - On-device Neural Engine
|
#include <DataflowExecutor.h>
Public Member Functions | |
DataflowExecutor (std::unique_ptr< compiler::LoweredGraph > lowered_graph, backend::BackendContexts &&backend_contexts, const compiler::TensorRegistries &tensor_regs, compiler::CodeMap &&code_map, const util::TracingCtx *tracing_ctx) | |
Constructs a DataflowExecutor object. | |
void | executeImpl (const ExecutionObservee &subject) override |
Public Member Functions inherited from onert::exec::ExecutorBase | |
ExecutorBase (std::unique_ptr< compiler::LoweredGraph > &&lowered_graph, backend::BackendContexts &&backend_contexts, const compiler::TensorRegistries &tensor_regs, const util::TracingCtx *tracing_ctx) | |
Construct a new ExecutorBase object. | |
virtual | ~ExecutorBase ()=default |
const ir::Graph & | graph () const final |
Returns graph object. | |
void | execute (const std::vector< backend::IPortableTensor * > &inputs, const std::vector< backend::IPortableTensor * > &outputs, const ExecutionOptions &options) override |
Execute with given input/output tensors. | |
uint32_t | inputSize () const override |
Get input size. | |
uint32_t | outputSize () const override |
Get output size. | |
const ir::OperandInfo & | inputInfo (uint32_t index) const override |
Get input info at index. | |
const ir::OperandInfo & | outputInfo (uint32_t index) const override |
Get output info at index. | |
ir::Layout | inputLayout (uint32_t index) const override |
Get input layout at index. | |
ir::Layout | outputLayout (uint32_t index) const override |
Get output layout at index. | |
void | setIndexedRanks (std::shared_ptr< ir::OperationIndexMap< int64_t > > ranks) final |
Set an ordering on operations. | |
void | addObserver (std::unique_ptr< IExecutionObserver > ref) |
backend::BackendContexts & | getBackendContexts () |
const ExecutionOptions & | currentOptions () const override |
Return current execution configuration. | |
Public Member Functions inherited from onert::exec::IExecutor | |
IExecutor ()=default | |
Construct a new IExecutor object. | |
virtual | ~IExecutor ()=default |
Destroy the IExecutor object. | |
Protected Member Functions | |
virtual void | notify (uint32_t finished_job_id) |
bool | noWaitingJobs () |
int64_t | calculateRank (const std::vector< ir::OperationIndex > &operations) |
void | emplaceToReadyJobs (const uint32_t &id) |
Protected Member Functions inherited from onert::exec::ExecutorBase | |
bool | hasDynamicInput () |
Returns true if any input tensor is dynamic; false if all are static tensors. | |
Protected Attributes | |
compiler::CodeMap | _code_map |
std::vector< std::unique_ptr< Job > > | _finished_jobs |
A vector of finished jobs for current execution After a run it has all the jobs of this execution for the next run. | |
std::vector< std::unique_ptr< Job > > | _waiting_jobs |
A vector of waiting jobs for current execution All the jobs are moved from _finished_jobs to it when start a run. | |
std::vector< std::list< uint32_t > > | _output_info |
Jobs' output info Used for notifying after finishing a job. | |
std::vector< uint32_t > | _initial_input_info |
std::vector< uint32_t > | _input_info |
std::multimap< int64_t, std::unique_ptr< Job >, std::greater< int64_t > > | _ready_jobs |
A collection of jobs that are ready for execution Jobs in it are ready to be scheduled. Ordered by priority from _indexed_ranks | |
std::unordered_map< uint32_t, ir::OperationIndex > | _job_to_op |
Which job runs which op and function. | |
Protected Attributes inherited from onert::exec::ExecutorBase | |
ExecObservers | _observers |
std::shared_ptr< ir::OperationIndexMap< int64_t > > | _indexed_ranks |
std::unique_ptr< compiler::LoweredGraph > | _lowered_graph |
backend::BackendContexts | _backend_contexts |
const ir::Graph & | _graph |
std::vector< backend::builtin::IOTensor * > | _input_tensors |
std::vector< backend::builtin::IOTensor * > | _output_tensors |
std::mutex | _mutex |
const util::TracingCtx * | _tracing_ctx |
ExecutionOptions | _current_options |
Definition at line 37 of file DataflowExecutor.h.
onert::exec::DataflowExecutor::DataflowExecutor | ( | std::unique_ptr< compiler::LoweredGraph > | lowered_graph, |
backend::BackendContexts && | backend_contexts, | ||
const compiler::TensorRegistries & | tensor_regs, | ||
compiler::CodeMap && | code_map, | ||
const util::TracingCtx * | tracing_ctx | ||
) |
Constructs a DataflowExecutor object.
lowered_graph | LoweredGraph object |
tensor_builders | Tensor builders that are currently used |
code_map | ir::Operation and its code map |
Definition at line 79 of file DataflowExecutor.cc.
References _code_map, _finished_jobs, _initial_input_info, _input_info, _job_to_op, onert::exec::ExecutorBase::_lowered_graph, _output_info, _waiting_jobs, onert::ir::OperandIndexSequence::contains(), onert::ir::IOperation::getInputs(), onert::ir::IOperation::getOutputs(), and VERBOSE.
|
protected |
Definition at line 28 of file DataflowExecutor.cc.
References onert::exec::ExecutorBase::_graph, onert::exec::ExecutorBase::_indexed_ranks, onert::util::ObjectManager< Index, Object >::at(), and onert::ir::Graph::operations().
Referenced by emplaceToReadyJobs().
|
protected |
Definition at line 53 of file DataflowExecutor.cc.
References _job_to_op, _ready_jobs, _waiting_jobs, and calculateRank().
Referenced by executeImpl(), onert::exec::ParallelExecutor::executeImpl(), and notify().
|
overridevirtual |
Implements onert::exec::ExecutorBase.
Reimplemented in onert::exec::ParallelExecutor.
Definition at line 126 of file DataflowExecutor.cc.
References _finished_jobs, onert::exec::ExecutorBase::_graph, _initial_input_info, _input_info, _job_to_op, onert::exec::ExecutorBase::_lowered_graph, _ready_jobs, onert::exec::ExecutorBase::_tracing_ctx, _waiting_jobs, emplaceToReadyJobs(), onert::util::TracingCtx::getSubgraphIndex(), onert::exec::ExecutorBase::hasDynamicInput(), notify(), onert::exec::ExecutionObservee::notifyJobBegin(), onert::exec::ExecutionObservee::notifyJobEnd(), onert::exec::ExecutionObservee::notifySubgraphBegin(), onert::exec::ExecutionObservee::notifySubgraphEnd(), noWaitingJobs(), and VERBOSE.
|
protectedvirtual |
Reimplemented in onert::exec::ParallelExecutor.
Definition at line 61 of file DataflowExecutor.cc.
References _input_info, _output_info, and emplaceToReadyJobs().
Referenced by executeImpl(), and onert::exec::ParallelExecutor::notify().
|
protected |
Definition at line 73 of file DataflowExecutor.cc.
References _waiting_jobs.
Referenced by executeImpl(), and onert::exec::ParallelExecutor::executeImpl().
|
protected |
Definition at line 64 of file DataflowExecutor.h.
Referenced by DataflowExecutor().
|
protected |
A vector of finished jobs for current execution After a run it has all the jobs of this execution for the next run.
Definition at line 69 of file DataflowExecutor.h.
Referenced by DataflowExecutor(), executeImpl(), and onert::exec::ParallelExecutor::executeImpl().
|
protected |
Definition at line 80 of file DataflowExecutor.h.
Referenced by DataflowExecutor(), executeImpl(), and onert::exec::ParallelExecutor::executeImpl().
|
protected |
Definition at line 81 of file DataflowExecutor.h.
Referenced by DataflowExecutor(), executeImpl(), onert::exec::ParallelExecutor::executeImpl(), and notify().
|
protected |
Which job runs which op and function.
Definition at line 90 of file DataflowExecutor.h.
Referenced by DataflowExecutor(), emplaceToReadyJobs(), executeImpl(), and onert::exec::ParallelExecutor::executeImpl().
|
protected |
Jobs' output info Used for notifying after finishing a job.
Definition at line 79 of file DataflowExecutor.h.
Referenced by DataflowExecutor(), and notify().
|
protected |
A collection of jobs that are ready for execution Jobs in it are ready to be scheduled. Ordered by priority from _indexed_ranks
Definition at line 87 of file DataflowExecutor.h.
Referenced by emplaceToReadyJobs(), executeImpl(), and onert::exec::ParallelExecutor::executeImpl().
|
protected |
A vector of waiting jobs for current execution All the jobs are moved from _finished_jobs to it when start a run.
Definition at line 74 of file DataflowExecutor.h.
Referenced by DataflowExecutor(), emplaceToReadyJobs(), executeImpl(), onert::exec::ParallelExecutor::executeImpl(), and noWaitingJobs().