Download presentation

Presentation is loading. Please wait.

Published byRodger Nicholas Skinner Modified over 5 years ago

1
Requirements on the Execution of Kahn Process Networks Marc Geilen and Twan Basten 11 April 2003 /e

2
Overview 1.Introduction: Kahn Process Networks 2.Implementing KPNs 3.Execution of KPNs 4.An Improved Scheduling Algorithm 5.Conclusions

3
/e 1. Introduction: Kahn Process Networks

4
/e Kahn Process Networks Arcs carry (possibly infinite) streams of tokens (audio samples, video frames, etc.) Nodes compute (continuous) functions on streams

5
/e Kahn Process Networks Good for multimedia and signal processing applications E.g., JPEG/MPEG decoding, image/video processing Explicit parallelism and communication No synchronization between processes required Programming paradigm for modern multi-processor architectures MIT’s RAW, Philips’ SpaceCake

6
/e KPN Semantics Arcs connecting functions Set of equations Continuous functions: unique least solution Semantics of KPN: least fixed- point Yields new continuous function: Compositionality

7
/e 2. Implementing KPNs

8
/e Realizations of KPNs Functions: sequential (determinate) programs, e.g. C++ or Java Blocking read operations

9
/e Realizations of KPNs Functions: sequential (determinate) programs, e.g. C++ or Java Arcs: FIFO queues Store tokens that are written but not yet read Blocking read operations

10
/e Realizations of KPNs Determinacy Output is independent of scheduling order Compositionality Hierarchically, recursively, … The Kahn Principle Operational model with fair execution and unbounded channels realizes the formal semantics

11
/e Implementation Requirements When is an implementation of a KPN good?

12
/e Implementation Requirements Boundedness

13
/e Implementation Requirements Completeness: infinite execution vs. chain of strings

14
/e 3. Execution of KPNs

15
/e Implementations of KPNs FIFO bounds balance memory usage and context switching (Minimal) FIFO bounds are undecidable Run-time management Often follow [Thomas Parks ’95] scheduling approach YAPI, Jade/Pagis, Ptolemy II among others Bounded FIFOs combine aspects of data- and demand driven execution

16
/e Implementations of KPNs Blocking on full FIFO: artificial deadlocks Causal chains

17
/e Implementations of KPNs Execution thread per process POSIX threads, Java threads, … Artificial deadlock detection and resolution strategies Often: global deadlock detection Low priority thread

18
/e Implementations of KPNs Parks’ algorithm yields infinite computation, but possibly not complete Local deadlocks may remain undetected (fairness is violated) Deadlocks are cyclic causal chains

19
/e 4. An Improved Scheduling Algorithm

20
/e Improved Scheduling Algorithm Deadlocks cannot be avoided by scheduling Artificial deadlock occurs (only) if FIFO bounds are too small (At least) one of the full FIFOs on a deadlock cycle must be too small Increase size of the smallest full FIFO

21
/e Improved Scheduling Algorithm 1.Schedule enabled processes (in a fair way) 2.Until deadlock occurs (cyclic causal chain) 3.Resolve deadlock by increasing the smallest full FIFO

22
/e Correctness Operational (LTS) semantics of KPNs (see paper) Equivalent to KPN semantics by the Kahn Principle Operational semantics of realizations of KPNs bounded channels Show that both implement the same function

23
/e Correctness The new scheduling algorithm realizes the the formal semantics of Kahn Process Networks: Every bounded and effective KPN is executed in bounded memory by our scheduler and produces the complete output.

24
/e Correctness Prerequisites: Boundedness: there exists a fair execution with finite FIFO bounds Effectiveness: every token that is produced on some channels is eventually also consumed Both prerequisites are necessary

25
/e Local deadlock detection Deadlock detection becomes more involved Need not be done at every step of the execution May be possible to do this concurrently

26
/e Conclusions Studied implementation requirements for KPNs: boundedness and completeness Widely used implementation of KPNs does not schedule all KPNs correctly We have presented an improved scheduling algorithm that resolves the problem for a large class of KPNs And proved its correctness (in the paper)

27
/e Future Work An implementation of the improved scheduling algorithm is being made for YAPI Efficiency of scheduling. Optimal bounds, efficient deadlock detection Hierarchical or distributed implementations Distributed deadlock detection

Similar presentations

© 2020 SlidePlayer.com Inc.

All rights reserved.

To make this website work, we log user data and share it with processors. To use this website, you must agree to our Privacy Policy, including cookie policy.

Ads by Google