I nstitute of S oftware SAVE 2015 C hinese A cademy of S ciences 同步数据流图在异构多处理器平台上 的时间能耗最优调度 朱雪阳 http://lcs.ios.ac.cn/~zxy/ 2015-12-05 Xue-Yang Zhu , Rongjie Yan, Yu-Lei Gu, Jian Zhang, Wenhui Zhang and Guangquan Zhang. Static Optimal Scheduling for Synchronous Data Flow Graphs with Model Checking. In Proc. of the 20 th International Symposium on Formal Methods (FM 2015). LNCS, vol. 9109, pp. 551–569.
Code Synthesis Scheduling Synchronous Data Models Flow Graphs Real-time Embedded Systems Background Xue-Yang Zhu Institute of Software 2015-12-05 SAVE2015 1 Chinese Academy of Sciences
Synchronous dataflow graphs (SDFG) are widely used for modeling data-driven • applications − digital signal processing (DSP) algorithms − streaming media programs A sample rate converter model--compact disk (CD) to digital audio tape (DAT)[Murthy, et al.1997] A satellite receiver [Ritz, et al. 1995] An MP3 playback [Wiggers, et al. 2007] Background Xue-Yang Zhu Institute of Software 2015-12-05 SAVE2015 2 Chinese Academy of Sciences
Code Model Checking Time and energy as a tool Synthesis optimization Scheduling Scheduling Synchronous Data Models Flow Graphs Real-time Embedded Systems Multi-processor Real-time requirements Resource limitations …… Background Xue-Yang Zhu Institute of Software 2015-12-05 SAVE2015 3 Chinese Academy of Sciences
• Model Description and Problem Formulation • Basic Idea of Our Methods • A Timed Automata Semantics of System Models • Static Optimal Scheduling and Mapping • Dealing with More Constraints • Case Studies • Conclusions and Future Work Outline Xue-Yang Zhu Institute of Software 2015-12-05 SAVE2015 4 Chinese Academy of Sciences
A system model includes an SDFG G and its execution platform P . − An execution platform P is a set of heterogeneous processors with energy consumption information – (in use, idle). − An SDFG is a finite directed graph G = <V, E> consumption rate cns(e) production rate prd(e) delay (number of initial eg. cns ( < C,A > )=2 eg. prd (< C,A >)=1 tokens) d(e) number of tokens consumed from the number of tokens produced onto eg. d (< C,A >)=3 < C,A > by each execution of A < C,A > by each execution of C. 2 1 1 1 1 A B C 2 1 1 computation time when v edge e actor v running on processor p t(v,p) - a FIFO channel - a computation eg. t(A,p1)= 1, t(A,p2)=3 - data dependency between actors Multi-rate, eg. prd (< C,A >)=1, cns ( < C,A > )=2 Model Description Different number of firings of each actor in one iteration of execution, eg. 1A,2B,2C in an iteration. Xue-Yang Zhu Institute of Software 2015-12-05 SAVE2015 5 Chinese Academy of Sciences
A static schedule arranges actors of an SDFG to be executed repeatedly. time arrangement and processor allocation G 1 : P 1 : M 1 =(G 1 ,P 1 ): One iteration of G 1 : one firing o f A , two firings of B and C, respectively.. Schedules of M 1 : Iteration period (IP): the average computation time of an iteration. IP=1/thr. 1-schedule : 1-schedule : IP=8 IP=6 Iter. energy cons. (IEC) is the average 2-schedule : energy cons. per iter. IEC=Occupied time *uEC+idle time *iEC IP=11/2 Eg. IEC=(6*90+0*10)+(3*45+3*15)=720 f -schedule : f iterations as a schedule cycle Schedules A ‘good’ schedule: its IP and IEC are as small as possible Xue-Yang Zhu Institute of Software 2015-12-05 SAVE2015 6 Chinese Academy of Sciences
A heterogeneous multi- An application processor platform System model M=(G,P) f : number of iterations Throughput-optimal Scheduling Best energy cons. Pareto-optimal f -schedules (our proposal) Energy cons.-optimal Best throughput Problem Formulation Xue-Yang Zhu Institute of Software 2015-12-05 SAVE2015 7 Chinese Academy of Sciences
• Model Description and Problem Formulation • Basic Idea of Our Methods • A Timed Automata Semantics of System Models • Static Optimal Scheduling and Mapping • Dealing with More Constraints • Case Studies • Conclusions and Future Work Outline Xue-Yang Zhu Institute of Software 2015-12-05 SAVE2015 8 Chinese Academy of Sciences
System model M=(G,P) f : number of iterations how N(P)TA Throughput-optimal Best energy cons. f -schedules CTL UPPAAL/CORA Traces Energy cons.-optimal how how Best throughput Scheduling Basic Idea of Our Methods Xue-Yang Zhu Institute of Software 2015-12-05 SAVE2015 9 Chinese Academy of Sciences
System model M=(G,P) f : number of iterations how N(P)TA Throughput-optimal Best energy cons. f -schedules CTL UPPAAL/CORA Traces Energy cons.-optimal Best throughput Scheduling Basic Idea of Our Methods Xue-Yang Zhu Institute of Software 2015-12-05 SAVE2015 10 Chinese Academy of Sciences
• 例:节能灯 -- 灯打开 2 分钟后自动关闭 Guard X: 时钟变量 X= 2 Location press X:= 0 On Off X< = 2 Update Invariant Timed Automata Xue-Yang Zhu Institute of Software 2015-12-05 SAVE2015 11 Chinese Academy of Sciences
• 例:节能灯 -- 灯打开 2 分钟后自动关闭 X= 2 y= = false y:= false || press On timer Off i y= = true y:= true X< = 2 X:= 0 Network of Timed Automata Xue-Yang Zhu Institute of Software 2015-12-05 SAVE2015 12 Chinese Academy of Sciences
G 1 : P 1 : M 1 : Two processors Actors execute in parallel if only there are sufficient tokens on their incoming edges and the resources they need are available. Processors run in parallel. good? NO! A TA for each actor and a TA for each processors. Once an actor is firing, it must be running on some processor. A Timed Automata Semantics of System Models Xue-Yang Zhu Institute of Software 2015-12-05 SAVE2015 13 Chinese Academy of Sciences
A TA ta p (α) models the behaviors of actor α running on processor p . readyS( α ) : There are sufficient tokens on the incoming edges of α and α has not fired f iterations sFiring( α ) : consumes tokens on the incoming edges of α according to their consumption rate. Reset the local clock x. eFiring( α ) : produces tokens to the outgoing x≤t ( α,p ) on location running and x==t( α,p ) on edge ri : edges of α according to their production rate. model α running on processor p. The behaviors of processor p is modeled by a TA ta p with non-deterministically selecting an actor from V : The behavior of system model M=(G,P) is modeled by an NTA: with a global clock glbClk . A Timed Automata Semantics of System Models Xue-Yang Zhu Institute of Software 2015-12-05 SAVE2015 14 Chinese Academy of Sciences
G 1 : P 1 : M 1 : e.g. , t(A,p1)=1, t(A,p2)=3 Two processors Two processes nta M1 : ta p1 ta p2 Select α Select α guard: readyS( α ) guard: readyS( α ) update: sFiring( α ),x:=0 update: sFiring( α ),x:=0 || idle idle running running Invariant: Invariant: guard: x==t( α ,p1) guard: x==t( α ,p2) x≤t ( α ,p1) x≤t ( α ,p2) update: eFiring( α ) update: eFiring( α ) A Timed Automata Semantics of System Models Xue-Yang Zhu Institute of Software 2015-12-05 SAVE2015 15 Chinese Academy of Sciences
ta p2 ta p1 2 || idle idle running running A B C 2 Initially, actor A is ready for a firing. glbClk=0: p1.sFiring(A) Assume p1 selects A to run. 2 || idle idle running running A B C 2 No actor is ready. Time elapses. glbClk=1: p1.eFiring(A) After 1 time step (t(A,p1)=1), the firing of A is ready to end. 2 || idle running idle running A B C 2 Actor B is ready for two firings. They can run on p1 and p2 glbClk=1: p1.sFiring(B), p2.sFiring(B) concurrently, or run on one processor sequentially . 2 || idle idle running running A B C 2 …… …… The behaviors of a system model is the behaviors of its NTA, semantics of which are traces of its LTS A Timed Automata Semantics of System Models Xue-Yang Zhu Institute of Software 2015-12-05 SAVE2015 16 Chinese Academy of Sciences
System model M=(G,P) f : number of iterations N(P)TA semantics LTS Throughput-optimal Best energy cons. f -schedules CTL UPPAAL/CORA Traces Energy cons.-optimal how Best throughput Scheduling Basic Idea of Our Methods Xue-Yang Zhu Institute of Software 2015-12-05 SAVE2015 17 Chinese Academy of Sciences
… … … glbClk=0: glbClk=1: glbClk=3: glbClk=7: Trace: p1.sFiring(A) p1.sFiring(B), p1.sFiring(C) p1.sFiring(C) p2.sFiring(B) 0 1 2 3 4 5 6 7 8 9 10 time p1 A B C C Schedule: p2 B How to get a ‘good’ schedule according to the optimization criteria? … … … glbClk=0: glbClk=1: glbClk=3: glbClk=5: Trace: p1.sFiring(A) p1.sFiring(B) p1.sFiring(B) p1.sFiring(C) p2.sFiring(C) 0 1 2 3 4 5 6 7 8 9 10 time p1 A B B C Schedule: p2 C ...... Traces and Schedules Xue-Yang Zhu Institute of Software 2015-12-05 SAVE2015 18 Chinese Academy of Sciences
System model M=(G,P) f : number of iterations N(P)TA semantics LTS Throughput-optimal Best energy cons. f -schedules CTL UPPAAL/CORA Traces Energy cons.-optimal how Best throughput Scheduling Basic Idea of Our Methods Xue-Yang Zhu Institute of Software 2015-12-05 SAVE2015 19 Chinese Academy of Sciences
Recommend
More recommend