dynamic dataflow - wiki.aalto.fi

22
Dynamic Dataflow Seminar on embedded systems

Upload: others

Post on 17-Feb-2022

13 views

Category:

Documents


0 download

TRANSCRIPT

Dynamic DataflowSeminar on embedded systems

Dataflow

• Dataflow programming, Dataflow architecture …

• Dataflow Models of Computation

• Computation is divided into nodes that can be executed concurrently

Dataflow Models of Computation

• Directed graph

• Data is split into tokens

• Tokens flow between the nodes

• Asynchronous execution of the nodes

Problems

• Tokens have to be buffered between the actors

• Unbounded execution is allowed

1. Unbounded buffer growth

2. Execution may deadlock when there are not enough tokens to continue

Synchronous Dataflow

• The number of tokens produced and consumed by an actor is fixed

• Guarantees bounded buffers and deadlock free execution

• Drawback: limited expressive power

Dynamic Dataflow

• Number of tokens produced and consumed by an actor in a single firing is not constrained

• Improved expression power over SDF

• Analysis more difficult compared to SDF

Dynamic Actors

• Variable number of tokens produced / consumed

• A control input

A conditional structure constructed with DDF actors

• Control tokens produced by actor B control the execution of either C or D

• Other constructs such as loops can be constructed as well

Dynamic Dataflow Scheduling

• SDF graphs can be scheduled statically at compile time

• DDF graphs can have data dependencies and may therefore require runtime scheduling

• Sometimes a hybrid approach is used

• In RVC-CAL the graphs are divided into maximal statically schedulable portions

• The runtime scheduler schedules these subgraphs

Cal Actor Language

• Used in MPEG RVC-CAL for standardising parts of the video encoding / decoding pipeline

• Commonly used as an example of a dynamic dataflow implementation

• Relatively mature toolchain and lots of examples available at http://orcc.sourceforge.net/

TensorFlow• Machine Learning library by Google

• Uses Dynamic dataflow model of computation

• Graph iterations

• Conditional execution of actors

• Stateful actors

• Control dependencies

• Supports parallel processing on heterogeneous platforms

• Has both C++ and Python APIs

Conclusion• The demand for intuitive and powerful ways to describe

parallel computations is growing.

• One answer to the demand is the use of dynamic dataflow models of computation.

• DDF MoCs have been a subject of research for decades but have failed to garner widespread support among practical users.

• With the introduction of new DDF frameworks such as TensorFlow and Naiad, the DDF models have a chance of making it to the mainstream.

DDF Experiment

Experiment

• Pick up a problem that DDF has been used to solve

• Use Open Event Machine to implement solution

Open Event Machine

• Runtime system for Multicore platforms

• Dynamically load balanced applications with run-to-completion principle

• Original implementation by Nokia Solutions and Networks

Terminology• Event is the unit of communication in OpenEM. Events are typically used

to carry data to process but can be data-less tokens as well. Corresponds to tokens in the DDF MoC

• Execution objects encapsulate the algorithm to execute when an event is received. Counterpart to the Actors in DDF

• Queues connect events (data) and execution objects (algorithms).

• Each queue is associated with one execution object and all queued events will be processed by this execution object.

• Scheduler moves allocated events to queues

• User calls the dispatcher in dispatch loop. Dispatcher calls the ‘receive’ function of the Execution object of the connected queue

Problem

• The common examples studied in the papers are

• Highly complex (HEVC decoder with over 20k slocs)

• Or too simple to make sense to implement with OpenEM

Solution

• Pick a task that DDF is used for

• Implement the relevant parts with OpenEM

• Approximate the rest

Experiment Outline• Input: video stream

• Utilise TI vision library functions to extract simple features from frames

• The high level structure of the application is similar to licence plate recognition for example

• Detect Cars > Detect Licence Plates > OCR the licence number

• Approximate shape recognition by some simple thresholding

• I.e. frame contains >N edges

• Compute a heavy operation

• Frame contains <N edges

• Drop frame and continue

• Introduction to Embedded Systems

• E. A. Lee and S. A. Seshia

• http://leeseshia.org/

• Scheduling Dynamic Dataflow Graphs

• http://ptolemy.eecs.berkeley.edu/publications/papers/93/jbuckThesis/thesis.pdf

• PiSDF

• K. Desnos, M. Pelcat, J.-F. Nezan, S. S. Bhattacharyya, and S. Aridhi

• https://halshs.archives-ouvertes.fr/hal-01075114/document

• Handbook of Signal Processing Systems, Dynamic Dataflow Graphs

• S. S. Bhattacharyya, E. F. Deprettere, R. Leupers, and J. Takala

• http://link.springer.com/chapter/10.1007%2F978-1-4614-6859-2_28

• CAL Actor Language

• J.Ekerand, J.Janneck

• Cal Language Report

• Google TensorFlow Library

• http://download.tensorflow.org/paper/whitepaper2015.pdf