130 likes | 142 Views
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.
E N D
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 networks • Collection of functional actors connected over unbounded FIFO buffers • Synchronous Dataflow (SDF) • # of tokens produced per actor fixed • Deadlock and boundedness are decidable 20 10 20 10 A B C
Motivation • Code size minimization • Code 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 optimization • Choose schedule that minimizes buffer memory
Schedules and Loops • Revisit • Repetitions vector • qG = (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 20 10 20 10 A B C
Impact of schedule on buffer size • Valid schedules Buffer size • ABCBCCC 50 • A(2B(2C)) 40 • A(2B)(4C) 60 • A(2BC)(2C) 50 • For a consistent SDF graph, there exists a fully reduced single appearance schedule occupying minimum possible buffer memory 20 10 20 10 A B C
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 SDF • Partition SDF into smaller subgraphs • Apply exact dynamic programming algorithm to minimum size subgraphs
Directed Acyclic SDF graphs • Topological sort • Ordering 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 C t s B D
Heuristic – Minimum legal cuts into Bounded Sets • Extend heuristic for chain-structured graph • Find 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 objectives • Minimize code size • Through single appearance schedules • Minimize buffer memory • Through buffer optimal looped schedules • Dynamic programming algorithm • For well ordered SDF graphs • Heuristic algorithms • For general acyclic SDF graphs
Possible improvements – future work • Consideration of a shared buffer approach • Calculate minimum shared buffer size for looped schedules • Trade-offs between code size Vs buffer size • Consider a multiple appearance schedule that could optimize buffer usage • Extend study to arbitrary SDF graphs