Joint Minimization of Code and Data for Synchronous Dataflow Programs
-
Upload
ciaran-landry -
Category
Documents
-
view
26 -
download
2
description
Transcript of Joint Minimization of Code and Data for Synchronous Dataflow Programs
Joint Minimization of Code and Data for Synchronous
Dataflow Programs
Kaushik Ravindran
EE 249 – Presentation
Objective
Develop a methodology for chain-structured SDF graphs to minimize
Code size
Buffer memory
Extend this into heuristic solutions for general acyclic SDF graphs
Quick Overview
Dataflow networksCollection of functional actors connected over unbounded FIFO buffers
Synchronous Dataflow (SDF)# of tokens produced per actor fixed
Deadlock and boundedness are decidable
A B C20 10 20 10
Motivation
Code size minimizationCode replication each time an actor appears in schedule
Amount of on-chip memory limited
Single Appearance schedules – optimally compact inline representation of SDF
Buffer memory optimizationChoose schedule that minimizes buffer memory
Schedules and Loops
Revisit
Repetitions vectorqG = (1, 2, 4) - Minimum number of actor firings
• q[source(e)] * produce(e) = q[sink(e)]*consume(e)
Flat single appearance schedule• (ω(1A)(2B)(4C))
(nS1S2…Sk) – ‘n’ successive firings of S1…Sk
A B C20 10 20 10
Impact of schedule on buffer size
Valid schedules Buffer size1. ABCBCCC 502. A(2B(2C)) 403. A(2B)(4C) 604. A(2BC)(2C) 50
For a consistent SDF graph, there exists a fully reduced single appearance schedule occupying minimum possible buffer memory
A B C20 10 20 10
R-Schedules
Recursively decompose chain-structured graph (G) into left (SL) and right (SR) subgraphs
Set or R-schedules always contains a schedule that attains minimum buffer requirement
Number of R-schedules = (1/n)(2n-2 C n-1)where n = number of actors in chain SDF
Dynamic Programming Algorithm
Determine R-schedule that minimizes buffer memory requirement
Minimum buffer memory requirement is cost of subgraphs and cost of split
b[i,j] = min(b[i,k] + b[k+1,j] + ci,j[k])
for i <= k < j
Running time O(n3)
Heuristic Solution
Introduce split on edge where minimum amount of data is transferred
Average run time O(n * log (n))
Can apply heuristic to arbitrary acyclic SDFPartition SDF into smaller subgraphsApply exact dynamic programming algorithm to minimum size subgraphs
Directed Acyclic SDF graphs
Topological sortOrdering of vertices, such that source vertex of each edge occurs earlier than sink vertex
Flat single appearance schedule corresponds to any valid topological sort
Four possible topological
sorts
A
B
C
D
s t
Heuristic – Minimum legal cuts into Bounded Sets
Extend heuristic for chain-structured graphFind cut with minimum amount of data transferred
• Kernighan and Lin approach
Recursively partition left and right halves to obtain schedule bodies
Run dynamic programming algorithm to optimize schedule
In retrospect
Main objectivesMinimize code size
• Through single appearance schedules
Minimize buffer memory• Through buffer optimal looped schedules
Dynamic programming algorithmFor well ordered SDF graphs
Heuristic algorithms For general acyclic SDF graphs
Possible improvements – future work
Consideration of a shared buffer approachCalculate minimum shared buffer size for looped schedules
Trade-offs between code size Vs buffer sizeConsider a multiple appearance schedule that could optimize buffer usage
Extend study to arbitrary SDF graphs