SlideShare a Scribd company logo
1 of 22
Download to read offline
ECE 565 Final Project
Fall, 2014
Authors:
Sidharth Kumar
UIN: 660059012, skumar37@uic.edu
UNIVERSITY OF ILLINOIS AT CHICAGO
Scheduling of Mutually Exclusive
Sets using Force Directed
Scheduling mechanism
Mohan Kumar Balasubramaniam
UIN: 671743509, mbalas3@uic.edu
UNIVERSITY OF ILLINOIS AT CHICAGO
1 | P a g e
Contents
Figures and Tables......................................................................................................................................2
Problem Statement......................................................................................................................................3
A detailed view of ME sets .........................................................................................................................4
Example [1]
.................................................................................................................................................4
ME Creation Rules....................................................................................................................................5
Formulations ...............................................................................................................................................6
Preliminary Algorithm...............................................................................................................................8
Ideas to approach the problem ..................................................................................................................9
Static Approach.......................................................................................................................................10
Example 1 – Hal*................................................................................................................................10
Example 2 – Motion_Vectors_DFG ...................................................................................................13
Dynamic Approach.................................................................................................................................15
Example 1 – Hal..................................................................................................................................16
Example 2 - Our example ...................................................................................................................18
Results of other DFGs...............................................................................................................................19
Conclusion .................................................................................................................................................20
References..................................................................................................................................................21
2 | P a g e
Figures and Tables
Figure 1: Mobility Range definition ..............................................................................................................6
Figure 2: Time frame and Probability of operations.....................................................................................6
Figure 3: Distribution graphs ........................................................................................................................7
Figure 4: Mobility range calculation for a ME set.........................................................................................7
Figure 5: Hal DFG ........................................................................................................................................10
Figure 6: Modified/Updated DFG ...............................................................................................................11
Figure 7: Updated Probability Values of operations...................................................................................11
Figure 8: DG for updated DFG.....................................................................................................................11
Figure 9: Example 1 Results ........................................................................................................................12
Figure 10: Motion_Vectors_DFG ................................................................................................................13
Figure 11: Example 2 Results ......................................................................................................................14
Figure 12: (a) Case 1: MR of one operation overlaps with MR of all the other operations in a ME (b) Case
2: MR of operations are staggered but intersecting for some range .........................................................15
Figure 13: Competing MEs..........................................................................................................................16
Figure 14: Time frames of ME created in dynamic approach.....................................................................17
Figure 15: Modified DFG and its DG ...........................................................................................................17
Figure 16: Hal Dynamic Result ....................................................................................................................17
Figure 17: Example DFG..............................................................................................................................18
Figure 18: Example Results .........................................................................................................................18
Table 1: Initial ASAP-ALAP Clock Cycles for example 1...............................................................................10
Table 2: Initial ASAP-ALAP Clock Cycles for example 2...............................................................................13
Table 3: Resource Requirement comparison for various DFGs ..................................................................19
Equation 1: 𝜇𝑖 = min𝐴𝐿𝐴𝑃 𝑎𝑐𝑟𝑜𝑠𝑠 𝑀𝑖 − max𝐴𝑆𝐴𝑃 𝑎𝑐𝑟𝑜𝑠𝑠 𝑀𝑖................................................................6
Equation 2: 𝑃𝑟𝑜𝑏𝑂𝑝𝑛, 𝑖 = 1𝜇𝑖 + 1.............................................................................................................6
Equation 3: 𝐷𝐺𝑖 = 𝑂𝑝𝑛 𝑡𝑦𝑝𝑒𝑃𝑟𝑜𝑏𝑂𝑝𝑛, 𝑖...................................................................................................7
Equation 4: 𝑅𝑀𝑆(𝑀𝑖) = 𝐷𝐺(1)2 + 𝐷𝐺(2)2 + ⋯ + 𝐷𝐺(𝑘)2𝑘...............................................................16
3 | P a g e
Problem Statement
A mutually exclusive (ME) set of operations S in a Data Flow Graph (DFG) contains operations
exactly one of which needs to be executed in any execution of the DFG. A DFG can contain 0 or
more such sets S1, S2... Sk of ME operations.
We want to derive and implement a Force Directed Scheduling (FDS) algorithm for MR-LCS to
schedule operations that may belong to ME sets so that the number of resources are reduced (or
remains the same in the worst case) compared to the algorithm that has no cognizance of ME sets.
4 | P a g e
A detailed view of ME sets
ME sets can be categorized as:
 Structural – Two operations lying in different branches of a conditional statement. This is
the most general case, also known as Conditional DFGs.
 Behavioral – Two operations not in different branches of a conditional statement, but lying
in different control paths. This can be imagined as the parallel (disjoint) paths on a DFG.
 Data flow – If two operations produce data used by operations that are ME.
Example [1]
T1 = (a + b) < c; /* -- 1 -- */
T2 = d + e; /* -- 2 -- */
T3 = c + 1; /* -- 3 -- */
if (y) {
if (T1)
u = T3 + d; /* -- 4 -- */
else if( !x )
u = T2 + d; /* -- 5 -- */
if ( !T1 && x )
z = T2 + e; /* -- 6 -- */
}
else {
T4 = T3 + e; /* -- 7 -- */
T5 = T4 + f; /* -- 8 -- */
u = T5 + g; /* -- 9 -- */
}
Operator pairs {+4, +5},{+4, +7},{+4, +8},{+4, +9},{+5,+7},{+5, +8},{+5, +9},{+6, +7},{+6,
+8} and {+6,9} are structural M.E. pairs.
Operator pairs {+4, +6} and {+5, +6} are behavioral.
Operator pairs {+1, +7},{+1, +8},{+1,+9},{+2, +3},{+2, +4},{+2, +7},{+2, +8} ,and{+2, +9} are
data-flow M.E. pairs.
In this project, we have considered only non-conditional DFGs (i.e. the DFG doesn’t contain any
fork-join or selector-distributor arrangement). We want to find a schedule in which scheduling any
of the resources in a ME set produces a valid result, i.e. the latency constraint is not violated. In
order to maintain this consistency, we can mention a few rules for creation of such simulated ME
sets [2].
5 | P a g e
Simulated ME Creation Rules
Two or more operations can belong to a Simulated ME set if:
1. They have same functionality (they use the same type of resource).
2. Their mobility ranges (ALAP - ASAP) intersect.
3. No two operations in the same ME set are successors/predecessors of each other (They
don’t lie on the same path).
4. No two operations in the same ME set are predecessors of the same node; restricted to a
distance of 1 (Only parent-child consideration).
As it can be seen from the above conditions that we are not worried about the functionality of the
DFG. Rather we are trying to schedule one representative from each ME set hoping for a reduction
in the required number of resources. The algorithm will still work for the conditional DFGs.
Note: All MEs that are mentioned from this point are simulated MEs
6 | P a g e
Formulations
As explained in [3], FDS calculates forces for each operation that needs to be scheduled in all the
possible control steps. Then it schedules the operation in that c-step where it has the least force.
Forces on each operation consist of self-force and predecessor/successor force. For purpose of
simplification, we will consider predecessor/successor only one level above or below respectively.
Here are the definitions that we need for force calculation.
 Mobility of representative of a ME set 𝑀𝑖 is:
Equation 1: 𝜇𝑖 = 𝑚𝑖𝑛(𝐴𝐿𝐴𝑃 𝑎𝑐𝑟𝑜𝑠𝑠 𝑀𝑖) − 𝑚𝑎𝑥(𝐴𝑆𝐴𝑃 𝑎𝑐𝑟𝑜𝑠𝑠 𝑀𝑖)
Figure 1: Mobility Range definition
 Probability of an operation being scheduled in clock cycle i is:
Equation 2: 𝑃𝑟𝑜𝑏(𝑂𝑝𝑛, 𝑖) =
1
𝜇 𝑖+1
Figure 2: Time frame and Probability of operations
Min ALAP
Max ASAP
7 | P a g e
 Distribution graph for an operation type in clock cycle i is:
Equation 3: 𝐷𝐺(𝑖) = ∑ 𝑃𝑟𝑜𝑏(𝑂𝑝𝑛, 𝑖)𝑂𝑝𝑛 𝑡𝑦𝑝𝑒
Figure 3: Distribution graphs
What changes from the basic FDS, are the mobility ranges and hence the rest follows. Since we
are defining a representative operation for a ME set, we need to have a mobility value which
satisfies all the operations in the ME set. So the intersection of the mobility ranges for all the
operations in a ME set will give us the common mobility range. Sometimes this range can be too
small and hence we might need to subdivide the ME set in subsets.
(a) (b)
Figure 4: Mobility range calculation for a ME set
From the above example, we are showing that keeping D in the ME set with E is more preferable
than keeping it with A, B, C. It results in a better mobility range for ME set {A, B, C} and D still
can share a resource with E. In case we cannot find any ME set in which D can be included, then
we have a dedicated resource for D.
We have used a heuristic to tackle this issue based on RMS (root mean square) values of the ME
sets. This will be explained in later sections.
A
B
C
D
Mobility
Range
(A, B, C, D)
E E
A
B
C
D
Mobility
Range (D, E)
Mobility
Range (A, B, C)
8 | P a g e
Preliminary Algorithm
Repeat until (all operations scheduled)
1. Evaluate mobility ranges for all operations
2. Based on the input ME sets, find the new mobility ranges for each representative
operation of each ME set (operation type in each ME set must be the same). Use
equation 1.
3. Compute the probability of the representative operations using equation 2.
4. Create the distribution graphs using equation 3.
5. Compute self-forces, predecessor/successor forces and total forces.
6. Schedule the operation in the time step with lowest force.
7. Update time-frame equal to the selected time step.
End Repeat
9 | P a g e
Ideas to approach the problem
Based on the preliminary algorithm, we only need to define how the ME sets are created and the
rest of it is the basic FDS. Here are the two approaches that can be used for solving this problem.
a. Static Approach
For a particular DFG, we can manually define the ME sets which satisfy the 4 rules defined
in the earlier section. Since we are fixing the representative sets, we call this a static
approach.
b. Dynamic/fluidic approach
The algorithm automatically generates all possible ME sets and finds out the best
combination to produce an optimal scheduling.
10 | P a g e
Static Approach
The creation of ME sets is done in the following way:
 Manually define the ME sets which satisfy the 4 conditions.
 Create a representative of each ME set Mi, such that any of the operations in Mi can be
scheduled in the same MR without any violations.
 Update the DFG (All ME nodes are merged in the representative node).
 Run FDS (using equations 1, 2, and 3) to find out the optimal schedule.
Let’s consider a few examples to understand the working of this approach.
Example 1 – Hal*
Figure 5: Hal DFG
Here, we are creating a ME set of multiplier nodes 5 and 7.
Node ASAP ALAP
5 1 2
7 1 3
Table 1: Initial ASAP-ALAP Clock Cycles for example 1
MR of representative set is found using equation 1 as min (2, 3) – max (1, 1) = 1.
The new ASAP, ALAP value of the representative of the ME set is (1, 2) which is same as for
node 5. So we can make node 5 as the representative and node 7 is merged with node 5. Figure 5
below shows the updated DFG.
* Delay for all operations is 1. We can change it to any value we want.
11 | P a g e
Figure 6: Modified/Updated DFG
Next, we look for the new probability values based on the updated DFG.
Figure 7: Updated Probability Values of operations
Based on the above, we will find the new DG values.
For multiply, DG (1) = 1 + 1 + ½ = 2.5
Other calculations can be done similarly.
Figure 8: DG for updated DFG
8
, 7
12 | P a g e
Representative node 5 has two clock cycle choices (1 and 2) where it can be scheduled. Let’s
calculate total force (self-force + p/s-force) on operation 5 in c-step 1:
𝐹𝑜𝑟𝑐𝑒(5, 1) = (2.5 − 2) ∗ 0.5 + (2 − 0.5) ∗ 0.5 + (1 ∗ 2 − 2 − 1.67) ∗
1
3
= +0.45
Similarly, total force on operation 5 in c-step 2:
𝐹𝑜𝑟𝑐𝑒(5, 2) = (−2.5 + 2) ∗ 0.5 + (−2 + 0.5) ∗ 0.5 + (−1 + 2 ∗ 2 − 1.67) ∗
1
3
= −0.55
So, FDS will prefer scheduling operation 5 (or 7) in c-step 2.
FDS does the above processing once we have given it the ME set. For this example, the simulations
results are given below:
Figure 9: Example 1 Results
As it can be seen above, we were able to successfully schedule both the nodes (5, 7) in 2nd
clock
cycle but the number of required resources remains the same.
The diagram on the right shows checker results. It checks if the scheduling-binding results are
satisfying all the constraints (latency, parent-child dependency, if all nodes were scheduled or
not).
Let’s consider another example.
Without ME With ME Checker result
13 | P a g e
Example 2 – Motion_Vectors_DFG
Figure 10: Motion_Vectors_DFG
Let’s create a ME set of nodes 6 and 13.
Node ASAP ALAP
6 1 1
13 1 2
Table 2: Initial ASAP-ALAP Clock Cycles for example 2
MR of representative set is min (2, 1) – max (1, 1) = 1.
The new ASAP, ALAP value of the representative of the ME set is (1, 1) which is same as for
node 6. So we can make node 6 as the representative and node 13 is merged with node 6. Node 6
has a single option of being scheduled in the 1st
cc.
Let’s take a look at the scheduling results.
14 | P a g e
Figure 11: Example 2 Results
In this case, we were able to save resource. So we can say that this procedure works well.
Disadvantage of this approach is that when we have a large graph, it gets cumbersome to find a
ME set manually. It is highly prone to errors. This is why we need an approach where the manual
labor can be reduced to a minimum and we should be able to find the best ME set available in a
graph of any size.
Without ME With ME
Checker result
Reduction in
resources
15 | P a g e
Dynamic Approach
The creation of ME sets is done in the following way:
 Generate all possible ME sets based on their mobility ranges (MR).
 If MR of an operation A is completely covered by all the other operations, then assign A
as the representative of the ME set.
 For operations with intersecting MR, define all possible unique combinations.
 For each of these combinations, update the DFG and calculate the DG value.
 Pick the ME set which produces the DG with highest root mean square.
 Run FDS on the graph with the above selected ME set.
We have divided the generation of possible ME sets in two cases in the following way.
Case – 1: When one of the operations can be taken as a representative for the whole set.
MR of A is covered by all the other operations, so scheduling any of the operations ∈ {A, B, C,
D} in MR of A will give a correct scheduling. This is shown in Figure 12 (a).
Hence, the MR of whole ME set is taken as MR of A.
(a) (b)
Figure 12: (a) Case 1: MR of one operation overlaps with MR of all the other operations in a ME
(b) Case 2: MR of operations are staggered but intersecting for some range
Case – 2: When the MR of the operations are staggered but intersect in a particular range.
We can create a representative node which has the MR as defined by equation A and this node
will represent the whole ME set. The example is shown in Figure 12 (b).
MR of given ME is ALAP (D) – ASAP (B).
The question arises that which combination should we select when we have competing MEs like
the one shown in Figure 13.
16 | P a g e
Figure 13: Competing MEs
For the above example, we have multiple choices of ME creation. Ex: ({A, B, C, D}, {E}) or ({A,
B, C}, {D, E}) or ({A, D}, {B, C}, {E}), etc.
We will need to apply a heuristic for finding the best ME set combination as it is not possible to
figure out which ME set combination will give us a better FDS solution without actually solving
it. We have used RMS criteria to differentiate ME set combinations. It gives a good approximation
for finding best ME set combination.
Let’s take an example. We want to compare
M1: {A, B, C, D}, {E} => Let representative of {A, B, C, D} = A, and representative of {E} = E.
M2: {A, D}, {B, C}, {E} => Let representative of {A, D} = A, representative of {B, C} = B, and
representative of {E} = E.
Let the total number of clock cycles over which DG exists is k. By this we mean that if in any cc,
the DG value is 0, we will not consider that in k.
Equation 4: 𝑅𝑀𝑆(𝑀𝑖) =
√𝐷𝐺(1)2+ 𝐷𝐺(2)2+⋯+𝐷𝐺(𝑘)2
𝑘
We pick the combination which has a larger RMS value.
Let’s take a few examples to understand the working of the dynamic approach.
Example 1 – Hal
We are referring to Figure 5: Hal DFG.
{0, 5, 7} or {1, 5, 7} can be grouped as a ME. Both have same DG value, so we can generate {0,
5, 7} as ME 1. Similarly {2, 6} is generated as ME 2.
ME 3 is an example of ME set with staggered MR. It includes {8, 9} and the new ASAP, ALAP
values are {2, 3}.
A
B
C
D Mobility
Range
(A, B, C, D)
E E
A
B
C
D
Mobility
Range (D, E)
Mobility
Range (A, B, C)
17 | P a g e
Figure 14: Time frames of ME created in dynamic approach
The modified DFG is produced on the basis of the generated MEs.
Figure 15: Modified DFG and its DG
FDS runs on the modified DFG and finds out the optimal scheduling based on the equations 1, 2,
and 3. Below are the results.
Figure 16: Hal Dynamic Result
ME 1
ME 2
ME 3
M1
M2
M3
18 | P a g e
Example 2 - Our example
Most of the DFGs did not have a staggered MR instance, hence we created our own graph to check
if it picks the best ME set combinations. The DFG is shown below.
Figure 17: Example DFG
In this DFG, the adders {8, 13} and {9, 13} can form ME sets. We run the code and see the
following result.
Figure 18: Example Results
Without ME With ME
Checker result
19 | P a g e
Results of other DFGs
DFG Total Number of
nodes
Res. Without
ME Sets
Res. Dynamic
Approach with
ME set creation
arf 28 6 3
collapse_pyr_dfg__113 56 24 7
ewf 34 5 2
feedback_points_dfg__7 53 17 6
h2v2_smooth_downsample_dfg__6 51 12 6
hal 11 5 5
horner_bezier_surf_dfg__12 18 6 5
interpolate_aux_dfg__12 108 38 5
matmul_dfg__3 109 25 6
motion_vectors_dfg__7 32 13 4
smooth_color_z_triangle_dfg__31 197 56 6
write_bmp_header_dfg__7 106 39 8
Table 3: Resource Requirement comparison for various DFGs
We can see from the above table that for large graphs, we can achieve a huge reduction in
resources.
20 | P a g e
Conclusion
 ME set creation can bring down the resource requirements (MR-LCS).
 FDS is easy to integrate in the algorithm once ME sets are generated.
 Dynamic approach is very effective when we have graphs with large number of nodes.
(Manually fixing the operations to be in same ME set is time consuming, as in static approach)
 The complexity of the problem increases whenever operations with intersecting MR are
encountered. As there can be multiple ME set combinations, we use RMS based heuristic to
find the best ME set combination.
 The algorithm can be extended for calculations of power or area optimizations in a ME aware
graph.
21 | P a g e
References
[1] Jian Li (UIUC), R. K. Gupta (U of Cali), “An algorithm to determine mutually exclusive
operations in behavioral descriptions”, Proceedings Design, Automation and Test in Europe,
Feb, 1998
[2] Shantanu Dutt, ECE-565, UIC, Fall – 2014
[3] Pierre G. Paulin, John P. Knight, “Force-Directed Scheduling for the Behavioral Synthesis of
ASIC’s”, IEEE-TCAD, June, 1989

More Related Content

Similar to Mohan_Sidharth_final_report_565_f14

EGME 431 Term ProjectJake Bailey, CSU FullertonSpring .docx
EGME 431 Term ProjectJake Bailey, CSU FullertonSpring .docxEGME 431 Term ProjectJake Bailey, CSU FullertonSpring .docx
EGME 431 Term ProjectJake Bailey, CSU FullertonSpring .docxSALU18
 
An Integer Programming Representation for Data Center Power-Aware Management ...
An Integer Programming Representation for Data Center Power-Aware Management ...An Integer Programming Representation for Data Center Power-Aware Management ...
An Integer Programming Representation for Data Center Power-Aware Management ...Arinto Murdopo
 
Resource scheduling algorithm
Resource scheduling algorithmResource scheduling algorithm
Resource scheduling algorithmShilpa Damor
 
An Introduction To Mathematical Modelling
An Introduction To Mathematical ModellingAn Introduction To Mathematical Modelling
An Introduction To Mathematical ModellingJoe Osborn
 
M.Tech: AI and Neural Networks Assignment II
M.Tech:  AI and Neural Networks Assignment IIM.Tech:  AI and Neural Networks Assignment II
M.Tech: AI and Neural Networks Assignment IIVijayananda Mohire
 
A Simulation Based Approach for Studying the Effect of Buffers on the Perform...
A Simulation Based Approach for Studying the Effect of Buffers on the Perform...A Simulation Based Approach for Studying the Effect of Buffers on the Perform...
A Simulation Based Approach for Studying the Effect of Buffers on the Perform...inventionjournals
 
AERO390Report_Xiang
AERO390Report_XiangAERO390Report_Xiang
AERO390Report_XiangXIANG Gao
 
TR-CIS-0420-09 BobZigon
TR-CIS-0420-09 BobZigonTR-CIS-0420-09 BobZigon
TR-CIS-0420-09 BobZigonBob Zigon
 
Informational user guide_1_212_mo_shell_1
Informational user guide_1_212_mo_shell_1Informational user guide_1_212_mo_shell_1
Informational user guide_1_212_mo_shell_1Hatim100
 
41713559 radio-access-network-protocols-and-signalling-analysis
41713559 radio-access-network-protocols-and-signalling-analysis41713559 radio-access-network-protocols-and-signalling-analysis
41713559 radio-access-network-protocols-and-signalling-analysisKevin Kang
 
Quantum Variables in Finance and Neuroscience Lecture Slides
Quantum Variables in Finance and Neuroscience Lecture SlidesQuantum Variables in Finance and Neuroscience Lecture Slides
Quantum Variables in Finance and Neuroscience Lecture SlidesLester Ingber
 
Statistics firstfive
Statistics firstfiveStatistics firstfive
Statistics firstfiveSukirti Garg
 
Year 13 Computing Project
Year 13 Computing ProjectYear 13 Computing Project
Year 13 Computing ProjectAlex Tang
 
Data replication (software)
Data replication (software) Data replication (software)
Data replication (software) Masoud Gholami
 
Thesis-MitchellColgan_LongTerm_PowerSystem_Planning
Thesis-MitchellColgan_LongTerm_PowerSystem_PlanningThesis-MitchellColgan_LongTerm_PowerSystem_Planning
Thesis-MitchellColgan_LongTerm_PowerSystem_PlanningElliott Mitchell-Colgan
 
Master Thesis - A Distributed Algorithm for Stateless Load Balancing
Master Thesis - A Distributed Algorithm for Stateless Load BalancingMaster Thesis - A Distributed Algorithm for Stateless Load Balancing
Master Thesis - A Distributed Algorithm for Stateless Load BalancingAndrea Tino
 
Vehicle Testing and Data Analysis
Vehicle Testing and Data AnalysisVehicle Testing and Data Analysis
Vehicle Testing and Data AnalysisBenjamin Labrosse
 

Similar to Mohan_Sidharth_final_report_565_f14 (20)

EGME 431 Term ProjectJake Bailey, CSU FullertonSpring .docx
EGME 431 Term ProjectJake Bailey, CSU FullertonSpring .docxEGME 431 Term ProjectJake Bailey, CSU FullertonSpring .docx
EGME 431 Term ProjectJake Bailey, CSU FullertonSpring .docx
 
An Integer Programming Representation for Data Center Power-Aware Management ...
An Integer Programming Representation for Data Center Power-Aware Management ...An Integer Programming Representation for Data Center Power-Aware Management ...
An Integer Programming Representation for Data Center Power-Aware Management ...
 
Resource scheduling algorithm
Resource scheduling algorithmResource scheduling algorithm
Resource scheduling algorithm
 
An Introduction To Mathematical Modelling
An Introduction To Mathematical ModellingAn Introduction To Mathematical Modelling
An Introduction To Mathematical Modelling
 
M.Tech: AI and Neural Networks Assignment II
M.Tech:  AI and Neural Networks Assignment IIM.Tech:  AI and Neural Networks Assignment II
M.Tech: AI and Neural Networks Assignment II
 
A Simulation Based Approach for Studying the Effect of Buffers on the Perform...
A Simulation Based Approach for Studying the Effect of Buffers on the Perform...A Simulation Based Approach for Studying the Effect of Buffers on the Perform...
A Simulation Based Approach for Studying the Effect of Buffers on the Perform...
 
main
mainmain
main
 
AERO390Report_Xiang
AERO390Report_XiangAERO390Report_Xiang
AERO390Report_Xiang
 
TR-CIS-0420-09 BobZigon
TR-CIS-0420-09 BobZigonTR-CIS-0420-09 BobZigon
TR-CIS-0420-09 BobZigon
 
Informational user guide_1_212_mo_shell_1
Informational user guide_1_212_mo_shell_1Informational user guide_1_212_mo_shell_1
Informational user guide_1_212_mo_shell_1
 
Thesis_JR
Thesis_JRThesis_JR
Thesis_JR
 
41713559 radio-access-network-protocols-and-signalling-analysis
41713559 radio-access-network-protocols-and-signalling-analysis41713559 radio-access-network-protocols-and-signalling-analysis
41713559 radio-access-network-protocols-and-signalling-analysis
 
Quantum Variables in Finance and Neuroscience Lecture Slides
Quantum Variables in Finance and Neuroscience Lecture SlidesQuantum Variables in Finance and Neuroscience Lecture Slides
Quantum Variables in Finance and Neuroscience Lecture Slides
 
thesis
thesisthesis
thesis
 
Statistics firstfive
Statistics firstfiveStatistics firstfive
Statistics firstfive
 
Year 13 Computing Project
Year 13 Computing ProjectYear 13 Computing Project
Year 13 Computing Project
 
Data replication (software)
Data replication (software) Data replication (software)
Data replication (software)
 
Thesis-MitchellColgan_LongTerm_PowerSystem_Planning
Thesis-MitchellColgan_LongTerm_PowerSystem_PlanningThesis-MitchellColgan_LongTerm_PowerSystem_Planning
Thesis-MitchellColgan_LongTerm_PowerSystem_Planning
 
Master Thesis - A Distributed Algorithm for Stateless Load Balancing
Master Thesis - A Distributed Algorithm for Stateless Load BalancingMaster Thesis - A Distributed Algorithm for Stateless Load Balancing
Master Thesis - A Distributed Algorithm for Stateless Load Balancing
 
Vehicle Testing and Data Analysis
Vehicle Testing and Data AnalysisVehicle Testing and Data Analysis
Vehicle Testing and Data Analysis
 

Mohan_Sidharth_final_report_565_f14

  • 1. ECE 565 Final Project Fall, 2014 Authors: Sidharth Kumar UIN: 660059012, skumar37@uic.edu UNIVERSITY OF ILLINOIS AT CHICAGO Scheduling of Mutually Exclusive Sets using Force Directed Scheduling mechanism Mohan Kumar Balasubramaniam UIN: 671743509, mbalas3@uic.edu UNIVERSITY OF ILLINOIS AT CHICAGO
  • 2. 1 | P a g e Contents Figures and Tables......................................................................................................................................2 Problem Statement......................................................................................................................................3 A detailed view of ME sets .........................................................................................................................4 Example [1] .................................................................................................................................................4 ME Creation Rules....................................................................................................................................5 Formulations ...............................................................................................................................................6 Preliminary Algorithm...............................................................................................................................8 Ideas to approach the problem ..................................................................................................................9 Static Approach.......................................................................................................................................10 Example 1 – Hal*................................................................................................................................10 Example 2 – Motion_Vectors_DFG ...................................................................................................13 Dynamic Approach.................................................................................................................................15 Example 1 – Hal..................................................................................................................................16 Example 2 - Our example ...................................................................................................................18 Results of other DFGs...............................................................................................................................19 Conclusion .................................................................................................................................................20 References..................................................................................................................................................21
  • 3. 2 | P a g e Figures and Tables Figure 1: Mobility Range definition ..............................................................................................................6 Figure 2: Time frame and Probability of operations.....................................................................................6 Figure 3: Distribution graphs ........................................................................................................................7 Figure 4: Mobility range calculation for a ME set.........................................................................................7 Figure 5: Hal DFG ........................................................................................................................................10 Figure 6: Modified/Updated DFG ...............................................................................................................11 Figure 7: Updated Probability Values of operations...................................................................................11 Figure 8: DG for updated DFG.....................................................................................................................11 Figure 9: Example 1 Results ........................................................................................................................12 Figure 10: Motion_Vectors_DFG ................................................................................................................13 Figure 11: Example 2 Results ......................................................................................................................14 Figure 12: (a) Case 1: MR of one operation overlaps with MR of all the other operations in a ME (b) Case 2: MR of operations are staggered but intersecting for some range .........................................................15 Figure 13: Competing MEs..........................................................................................................................16 Figure 14: Time frames of ME created in dynamic approach.....................................................................17 Figure 15: Modified DFG and its DG ...........................................................................................................17 Figure 16: Hal Dynamic Result ....................................................................................................................17 Figure 17: Example DFG..............................................................................................................................18 Figure 18: Example Results .........................................................................................................................18 Table 1: Initial ASAP-ALAP Clock Cycles for example 1...............................................................................10 Table 2: Initial ASAP-ALAP Clock Cycles for example 2...............................................................................13 Table 3: Resource Requirement comparison for various DFGs ..................................................................19 Equation 1: 𝜇𝑖 = min𝐴𝐿𝐴𝑃 𝑎𝑐𝑟𝑜𝑠𝑠 𝑀𝑖 − max𝐴𝑆𝐴𝑃 𝑎𝑐𝑟𝑜𝑠𝑠 𝑀𝑖................................................................6 Equation 2: 𝑃𝑟𝑜𝑏𝑂𝑝𝑛, 𝑖 = 1𝜇𝑖 + 1.............................................................................................................6 Equation 3: 𝐷𝐺𝑖 = 𝑂𝑝𝑛 𝑡𝑦𝑝𝑒𝑃𝑟𝑜𝑏𝑂𝑝𝑛, 𝑖...................................................................................................7 Equation 4: 𝑅𝑀𝑆(𝑀𝑖) = 𝐷𝐺(1)2 + 𝐷𝐺(2)2 + ⋯ + 𝐷𝐺(𝑘)2𝑘...............................................................16
  • 4. 3 | P a g e Problem Statement A mutually exclusive (ME) set of operations S in a Data Flow Graph (DFG) contains operations exactly one of which needs to be executed in any execution of the DFG. A DFG can contain 0 or more such sets S1, S2... Sk of ME operations. We want to derive and implement a Force Directed Scheduling (FDS) algorithm for MR-LCS to schedule operations that may belong to ME sets so that the number of resources are reduced (or remains the same in the worst case) compared to the algorithm that has no cognizance of ME sets.
  • 5. 4 | P a g e A detailed view of ME sets ME sets can be categorized as:  Structural – Two operations lying in different branches of a conditional statement. This is the most general case, also known as Conditional DFGs.  Behavioral – Two operations not in different branches of a conditional statement, but lying in different control paths. This can be imagined as the parallel (disjoint) paths on a DFG.  Data flow – If two operations produce data used by operations that are ME. Example [1] T1 = (a + b) < c; /* -- 1 -- */ T2 = d + e; /* -- 2 -- */ T3 = c + 1; /* -- 3 -- */ if (y) { if (T1) u = T3 + d; /* -- 4 -- */ else if( !x ) u = T2 + d; /* -- 5 -- */ if ( !T1 && x ) z = T2 + e; /* -- 6 -- */ } else { T4 = T3 + e; /* -- 7 -- */ T5 = T4 + f; /* -- 8 -- */ u = T5 + g; /* -- 9 -- */ } Operator pairs {+4, +5},{+4, +7},{+4, +8},{+4, +9},{+5,+7},{+5, +8},{+5, +9},{+6, +7},{+6, +8} and {+6,9} are structural M.E. pairs. Operator pairs {+4, +6} and {+5, +6} are behavioral. Operator pairs {+1, +7},{+1, +8},{+1,+9},{+2, +3},{+2, +4},{+2, +7},{+2, +8} ,and{+2, +9} are data-flow M.E. pairs. In this project, we have considered only non-conditional DFGs (i.e. the DFG doesn’t contain any fork-join or selector-distributor arrangement). We want to find a schedule in which scheduling any of the resources in a ME set produces a valid result, i.e. the latency constraint is not violated. In order to maintain this consistency, we can mention a few rules for creation of such simulated ME sets [2].
  • 6. 5 | P a g e Simulated ME Creation Rules Two or more operations can belong to a Simulated ME set if: 1. They have same functionality (they use the same type of resource). 2. Their mobility ranges (ALAP - ASAP) intersect. 3. No two operations in the same ME set are successors/predecessors of each other (They don’t lie on the same path). 4. No two operations in the same ME set are predecessors of the same node; restricted to a distance of 1 (Only parent-child consideration). As it can be seen from the above conditions that we are not worried about the functionality of the DFG. Rather we are trying to schedule one representative from each ME set hoping for a reduction in the required number of resources. The algorithm will still work for the conditional DFGs. Note: All MEs that are mentioned from this point are simulated MEs
  • 7. 6 | P a g e Formulations As explained in [3], FDS calculates forces for each operation that needs to be scheduled in all the possible control steps. Then it schedules the operation in that c-step where it has the least force. Forces on each operation consist of self-force and predecessor/successor force. For purpose of simplification, we will consider predecessor/successor only one level above or below respectively. Here are the definitions that we need for force calculation.  Mobility of representative of a ME set 𝑀𝑖 is: Equation 1: 𝜇𝑖 = 𝑚𝑖𝑛(𝐴𝐿𝐴𝑃 𝑎𝑐𝑟𝑜𝑠𝑠 𝑀𝑖) − 𝑚𝑎𝑥(𝐴𝑆𝐴𝑃 𝑎𝑐𝑟𝑜𝑠𝑠 𝑀𝑖) Figure 1: Mobility Range definition  Probability of an operation being scheduled in clock cycle i is: Equation 2: 𝑃𝑟𝑜𝑏(𝑂𝑝𝑛, 𝑖) = 1 𝜇 𝑖+1 Figure 2: Time frame and Probability of operations Min ALAP Max ASAP
  • 8. 7 | P a g e  Distribution graph for an operation type in clock cycle i is: Equation 3: 𝐷𝐺(𝑖) = ∑ 𝑃𝑟𝑜𝑏(𝑂𝑝𝑛, 𝑖)𝑂𝑝𝑛 𝑡𝑦𝑝𝑒 Figure 3: Distribution graphs What changes from the basic FDS, are the mobility ranges and hence the rest follows. Since we are defining a representative operation for a ME set, we need to have a mobility value which satisfies all the operations in the ME set. So the intersection of the mobility ranges for all the operations in a ME set will give us the common mobility range. Sometimes this range can be too small and hence we might need to subdivide the ME set in subsets. (a) (b) Figure 4: Mobility range calculation for a ME set From the above example, we are showing that keeping D in the ME set with E is more preferable than keeping it with A, B, C. It results in a better mobility range for ME set {A, B, C} and D still can share a resource with E. In case we cannot find any ME set in which D can be included, then we have a dedicated resource for D. We have used a heuristic to tackle this issue based on RMS (root mean square) values of the ME sets. This will be explained in later sections. A B C D Mobility Range (A, B, C, D) E E A B C D Mobility Range (D, E) Mobility Range (A, B, C)
  • 9. 8 | P a g e Preliminary Algorithm Repeat until (all operations scheduled) 1. Evaluate mobility ranges for all operations 2. Based on the input ME sets, find the new mobility ranges for each representative operation of each ME set (operation type in each ME set must be the same). Use equation 1. 3. Compute the probability of the representative operations using equation 2. 4. Create the distribution graphs using equation 3. 5. Compute self-forces, predecessor/successor forces and total forces. 6. Schedule the operation in the time step with lowest force. 7. Update time-frame equal to the selected time step. End Repeat
  • 10. 9 | P a g e Ideas to approach the problem Based on the preliminary algorithm, we only need to define how the ME sets are created and the rest of it is the basic FDS. Here are the two approaches that can be used for solving this problem. a. Static Approach For a particular DFG, we can manually define the ME sets which satisfy the 4 rules defined in the earlier section. Since we are fixing the representative sets, we call this a static approach. b. Dynamic/fluidic approach The algorithm automatically generates all possible ME sets and finds out the best combination to produce an optimal scheduling.
  • 11. 10 | P a g e Static Approach The creation of ME sets is done in the following way:  Manually define the ME sets which satisfy the 4 conditions.  Create a representative of each ME set Mi, such that any of the operations in Mi can be scheduled in the same MR without any violations.  Update the DFG (All ME nodes are merged in the representative node).  Run FDS (using equations 1, 2, and 3) to find out the optimal schedule. Let’s consider a few examples to understand the working of this approach. Example 1 – Hal* Figure 5: Hal DFG Here, we are creating a ME set of multiplier nodes 5 and 7. Node ASAP ALAP 5 1 2 7 1 3 Table 1: Initial ASAP-ALAP Clock Cycles for example 1 MR of representative set is found using equation 1 as min (2, 3) – max (1, 1) = 1. The new ASAP, ALAP value of the representative of the ME set is (1, 2) which is same as for node 5. So we can make node 5 as the representative and node 7 is merged with node 5. Figure 5 below shows the updated DFG. * Delay for all operations is 1. We can change it to any value we want.
  • 12. 11 | P a g e Figure 6: Modified/Updated DFG Next, we look for the new probability values based on the updated DFG. Figure 7: Updated Probability Values of operations Based on the above, we will find the new DG values. For multiply, DG (1) = 1 + 1 + ½ = 2.5 Other calculations can be done similarly. Figure 8: DG for updated DFG 8 , 7
  • 13. 12 | P a g e Representative node 5 has two clock cycle choices (1 and 2) where it can be scheduled. Let’s calculate total force (self-force + p/s-force) on operation 5 in c-step 1: 𝐹𝑜𝑟𝑐𝑒(5, 1) = (2.5 − 2) ∗ 0.5 + (2 − 0.5) ∗ 0.5 + (1 ∗ 2 − 2 − 1.67) ∗ 1 3 = +0.45 Similarly, total force on operation 5 in c-step 2: 𝐹𝑜𝑟𝑐𝑒(5, 2) = (−2.5 + 2) ∗ 0.5 + (−2 + 0.5) ∗ 0.5 + (−1 + 2 ∗ 2 − 1.67) ∗ 1 3 = −0.55 So, FDS will prefer scheduling operation 5 (or 7) in c-step 2. FDS does the above processing once we have given it the ME set. For this example, the simulations results are given below: Figure 9: Example 1 Results As it can be seen above, we were able to successfully schedule both the nodes (5, 7) in 2nd clock cycle but the number of required resources remains the same. The diagram on the right shows checker results. It checks if the scheduling-binding results are satisfying all the constraints (latency, parent-child dependency, if all nodes were scheduled or not). Let’s consider another example. Without ME With ME Checker result
  • 14. 13 | P a g e Example 2 – Motion_Vectors_DFG Figure 10: Motion_Vectors_DFG Let’s create a ME set of nodes 6 and 13. Node ASAP ALAP 6 1 1 13 1 2 Table 2: Initial ASAP-ALAP Clock Cycles for example 2 MR of representative set is min (2, 1) – max (1, 1) = 1. The new ASAP, ALAP value of the representative of the ME set is (1, 1) which is same as for node 6. So we can make node 6 as the representative and node 13 is merged with node 6. Node 6 has a single option of being scheduled in the 1st cc. Let’s take a look at the scheduling results.
  • 15. 14 | P a g e Figure 11: Example 2 Results In this case, we were able to save resource. So we can say that this procedure works well. Disadvantage of this approach is that when we have a large graph, it gets cumbersome to find a ME set manually. It is highly prone to errors. This is why we need an approach where the manual labor can be reduced to a minimum and we should be able to find the best ME set available in a graph of any size. Without ME With ME Checker result Reduction in resources
  • 16. 15 | P a g e Dynamic Approach The creation of ME sets is done in the following way:  Generate all possible ME sets based on their mobility ranges (MR).  If MR of an operation A is completely covered by all the other operations, then assign A as the representative of the ME set.  For operations with intersecting MR, define all possible unique combinations.  For each of these combinations, update the DFG and calculate the DG value.  Pick the ME set which produces the DG with highest root mean square.  Run FDS on the graph with the above selected ME set. We have divided the generation of possible ME sets in two cases in the following way. Case – 1: When one of the operations can be taken as a representative for the whole set. MR of A is covered by all the other operations, so scheduling any of the operations ∈ {A, B, C, D} in MR of A will give a correct scheduling. This is shown in Figure 12 (a). Hence, the MR of whole ME set is taken as MR of A. (a) (b) Figure 12: (a) Case 1: MR of one operation overlaps with MR of all the other operations in a ME (b) Case 2: MR of operations are staggered but intersecting for some range Case – 2: When the MR of the operations are staggered but intersect in a particular range. We can create a representative node which has the MR as defined by equation A and this node will represent the whole ME set. The example is shown in Figure 12 (b). MR of given ME is ALAP (D) – ASAP (B). The question arises that which combination should we select when we have competing MEs like the one shown in Figure 13.
  • 17. 16 | P a g e Figure 13: Competing MEs For the above example, we have multiple choices of ME creation. Ex: ({A, B, C, D}, {E}) or ({A, B, C}, {D, E}) or ({A, D}, {B, C}, {E}), etc. We will need to apply a heuristic for finding the best ME set combination as it is not possible to figure out which ME set combination will give us a better FDS solution without actually solving it. We have used RMS criteria to differentiate ME set combinations. It gives a good approximation for finding best ME set combination. Let’s take an example. We want to compare M1: {A, B, C, D}, {E} => Let representative of {A, B, C, D} = A, and representative of {E} = E. M2: {A, D}, {B, C}, {E} => Let representative of {A, D} = A, representative of {B, C} = B, and representative of {E} = E. Let the total number of clock cycles over which DG exists is k. By this we mean that if in any cc, the DG value is 0, we will not consider that in k. Equation 4: 𝑅𝑀𝑆(𝑀𝑖) = √𝐷𝐺(1)2+ 𝐷𝐺(2)2+⋯+𝐷𝐺(𝑘)2 𝑘 We pick the combination which has a larger RMS value. Let’s take a few examples to understand the working of the dynamic approach. Example 1 – Hal We are referring to Figure 5: Hal DFG. {0, 5, 7} or {1, 5, 7} can be grouped as a ME. Both have same DG value, so we can generate {0, 5, 7} as ME 1. Similarly {2, 6} is generated as ME 2. ME 3 is an example of ME set with staggered MR. It includes {8, 9} and the new ASAP, ALAP values are {2, 3}. A B C D Mobility Range (A, B, C, D) E E A B C D Mobility Range (D, E) Mobility Range (A, B, C)
  • 18. 17 | P a g e Figure 14: Time frames of ME created in dynamic approach The modified DFG is produced on the basis of the generated MEs. Figure 15: Modified DFG and its DG FDS runs on the modified DFG and finds out the optimal scheduling based on the equations 1, 2, and 3. Below are the results. Figure 16: Hal Dynamic Result ME 1 ME 2 ME 3 M1 M2 M3
  • 19. 18 | P a g e Example 2 - Our example Most of the DFGs did not have a staggered MR instance, hence we created our own graph to check if it picks the best ME set combinations. The DFG is shown below. Figure 17: Example DFG In this DFG, the adders {8, 13} and {9, 13} can form ME sets. We run the code and see the following result. Figure 18: Example Results Without ME With ME Checker result
  • 20. 19 | P a g e Results of other DFGs DFG Total Number of nodes Res. Without ME Sets Res. Dynamic Approach with ME set creation arf 28 6 3 collapse_pyr_dfg__113 56 24 7 ewf 34 5 2 feedback_points_dfg__7 53 17 6 h2v2_smooth_downsample_dfg__6 51 12 6 hal 11 5 5 horner_bezier_surf_dfg__12 18 6 5 interpolate_aux_dfg__12 108 38 5 matmul_dfg__3 109 25 6 motion_vectors_dfg__7 32 13 4 smooth_color_z_triangle_dfg__31 197 56 6 write_bmp_header_dfg__7 106 39 8 Table 3: Resource Requirement comparison for various DFGs We can see from the above table that for large graphs, we can achieve a huge reduction in resources.
  • 21. 20 | P a g e Conclusion  ME set creation can bring down the resource requirements (MR-LCS).  FDS is easy to integrate in the algorithm once ME sets are generated.  Dynamic approach is very effective when we have graphs with large number of nodes. (Manually fixing the operations to be in same ME set is time consuming, as in static approach)  The complexity of the problem increases whenever operations with intersecting MR are encountered. As there can be multiple ME set combinations, we use RMS based heuristic to find the best ME set combination.  The algorithm can be extended for calculations of power or area optimizations in a ME aware graph.
  • 22. 21 | P a g e References [1] Jian Li (UIUC), R. K. Gupta (U of Cali), “An algorithm to determine mutually exclusive operations in behavioral descriptions”, Proceedings Design, Automation and Test in Europe, Feb, 1998 [2] Shantanu Dutt, ECE-565, UIC, Fall – 2014 [3] Pierre G. Paulin, John P. Knight, “Force-Directed Scheduling for the Behavioral Synthesis of ASIC’s”, IEEE-TCAD, June, 1989