### Reformat code

parent c2503206
 ... ... @@ -4,23 +4,23 @@ Determines a hardware architecture that efficiently executes a given algorithm. Tasks are \begin{itemize} \item \textcolor{red}{Allocation}: Determine necessary hardware resources \item \textcolor{red}{Scheduling}: Determine timing of individual operations \item \textcolor{red}{Binding}: Determine relation between individual operations and HW resources \item \textcolor{red}{Allocation}: Determine necessary hardware resources \item \textcolor{red}{Scheduling}: Determine timing of individual operations \item \textcolor{red}{Binding}: Determine relation between individual operations and HW resources \end{itemize} \vspace{0.2cm} \subsection{Models (10-3)} see Architecture Models \begin{itemize} \item \textcolor{red}{Sequence Graph} $G_S = (V_S,E_S)$ where $V_S$ denotes the operations and $E_S$ the dependence relations of the algorithm \item \textcolor{red}{Resource Graph} (bipartite) $G_R = (V_R,E_R)$ where $V_R=V_S \cup V_T$ and $V_T$ denotes the resource types of the architecture ($V_S$ are the operations). An edge $(v_s,v_t) \in E_R$ represents availability of resource type $v_t$ for operation $v_s$. \item \textcolor{red}{Cost function} for operations $c: V_T \rightarrow \mathbb{Z}$. \item \textcolor{red}{Execution times} $w: E_R \rightarrow \mathbb{Z}^{\geq 0}$ denote execution time of operation $v_s$ on resource type $v_t$. \item An \textcolor{red}{allocation} $\alpha: V_T \rightarrow \mathbb{Z}^{\geq0}$ assigns to each resource type $v_t \in V_T$ the number $\alpha(v_t)$ of available resources. \item A \textcolor{red}{binding} (which operation on which ressource) is defined by $\beta: V_S \rightarrow V_T$ and $\gamma: V_S \rightarrow \mathbb{Z}^{\geq0}$. $\beta(v_s) = v_t$ and $\gamma(v_s)=r$ mean that operation $v_s \in V_S$ is implemented on the $r$-th instance of resource type $v_t \in V_T$. \item A \textcolor{red}{schedule} $\tau: V_S \rightarrow \mathbb{Z}^{\geq0}$ determines the starting times of operations. It is feasible iff \item \textcolor{red}{Sequence Graph} $G_S = (V_S,E_S)$ where $V_S$ denotes the operations and $E_S$ the dependence relations of the algorithm \item \textcolor{red}{Resource Graph} (bipartite) $G_R = (V_R,E_R)$ where $V_R=V_S \cup V_T$ and $V_T$ denotes the resource types of the architecture ($V_S$ are the operations). An edge $(v_s,v_t) \in E_R$ represents availability of resource type $v_t$ for operation $v_s$. \item \textcolor{red}{Cost function} for operations $c: V_T \rightarrow \mathbb{Z}$. \item \textcolor{red}{Execution times} $w: E_R \rightarrow \mathbb{Z}^{\geq 0}$ denote execution time of operation $v_s$ on resource type $v_t$. \item An \textcolor{red}{allocation} $\alpha: V_T \rightarrow \mathbb{Z}^{\geq0}$ assigns to each resource type $v_t \in V_T$ the number $\alpha(v_t)$ of available resources. \item A \textcolor{red}{binding} (which operation on which ressource) is defined by $\beta: V_S \rightarrow V_T$ and $\gamma: V_S \rightarrow \mathbb{Z}^{\geq0}$. $\beta(v_s) = v_t$ and $\gamma(v_s)=r$ mean that operation $v_s \in V_S$ is implemented on the $r$-th instance of resource type $v_t \in V_T$. \item A \textcolor{red}{schedule} $\tau: V_S \rightarrow \mathbb{Z}^{\geq0}$ determines the starting times of operations. It is feasible iff $$\forall (v_i,v_j) \in E_S: \quad \tau(v_j)-\tau(v_i) \geq w(v_i) \defeq w(v_i,\beta(v_i))$$ \item \textcolor{red}{latency} $L$ of a schedule is the time between start node $v_0$ and end node $v_n$: $$L=\tau(v_n)-\tau(v_0)$$ \item \textcolor{red}{latency} $L$ of a schedule is the time between start node $v_0$ and end node $v_n$: $$L=\tau(v_n)-\tau(v_0)$$ \end{itemize} \subsection{Multiobjective Optimization (10-25)} ... ... @@ -40,15 +40,15 @@ Optimize latency, hardware cost, power and energy \subsection{Classification of Scheduling Algorithms (10-32)} \begin{itemize} \item \textcolor{red}{Unlimited} vs. \textcolor{red}{limited} resources \item \textcolor{red}{Iterative} (initial solution to architecture synthesis stepwise improved) vs. \textcolor{red}{constructive} (synthesis problem solved in one step) vs. \textcolor{red}{Transformative} (initial problem converted into classical optimization problem) \item \textcolor{red}{Unlimited} vs. \textcolor{red}{limited} resources \item \textcolor{red}{Iterative} (initial solution to architecture synthesis stepwise improved) vs. \textcolor{red}{constructive} (synthesis problem solved in one step) vs. \textcolor{red}{Transformative} (initial problem converted into classical optimization problem) \end{itemize}~ \vspace{0.2cm} \subsection{Scheduling without resource constraints (10-31)} \begin{itemize} \item Do as preparatory step for general synthesis \item or to determine bounds on feasible schedules \item or if there is a dedicated resource for each operation \item Do as preparatory step for general synthesis \item or to determine bounds on feasible schedules \item or if there is a dedicated resource for each operation \end{itemize} \subsubsection{As Soon As Possible Algorithm (ASAP)} ... ... @@ -82,9 +82,9 @@ guarantees that a feasible schedule exists for this latency. \subsubsection{Scheduling with Timing Constraints} \begin{itemize} \item Deadlines: Latest finishing time \item Release Times: Earliest starting time \item Relative Constraints: Maximum or minimum differences \item Deadlines: Latest finishing time \item Release Times: Earliest starting time \item Relative Constraints: Maximum or minimum differences \end{itemize} Model all timing constraints using relative constraints: ... ... @@ -119,10 +119,10 @@ $$\forall v_i \in V_C\setminus\{v_0\}: \quad \tau(v_i) = -\infty$$ \begin{itemize} \item Each operation has a static priority \item Algorithm schedules one time step after the other \item Heuristic Algorithm \item Doesn't minimize the latency in general. In the special case, that the \item Each operation has a static priority \item Algorithm schedules one time step after the other \item Heuristic Algorithm \item Doesn't minimize the latency in general. In the special case, that the dependency graph is a tree and all tasks have the same execution time, minimal latency is guaranteed (sufficient but not necessary). \end{itemize} ... ... @@ -153,9 +153,9 @@ Produces the following Ablaufplan (indep. of priorities)\\ \subsubsection{Integer Linear Programming (10-50)} \begin{itemize} \item Yields optimal solution \item Solves scheduling, binding and allocation simultaneously \item Assumptions for following example: \item Yields optimal solution \item Solves scheduling, binding and allocation simultaneously \item Assumptions for following example: \subitem Binding is already fixed (execution times $w(v_i)$ known) \subitem Earliest/latest starting times of operations $v_i$ are $l_i,h_i$ \end{itemize} ... ... @@ -176,44 +176,44 @@ Formally: &\sum_{\forall i: (v_i,v_k) \in E_R} \sum_{p'=\max\{0,t-h_i\}}^{\min\{w(v_i)-1,t-l_i\}} x_{i,t-p'} \leq \alpha(v_k) \end{alignedat} \end{equation*} \item Start condition: \begin{equation} \item Start condition: \begin{equation} \tau(\nu_0) = 0 \end{equation} \item Minimize $$L=\tau(v_n) - \tau(v_0)$$. \end{compactenum}~\newline \end{equation} \item Minimize $$L=\tau(v_n) - \tau(v_0)$$ \end{compactenum} Example: Example: \includegraphics[width=0.5\linewidth]{integer_LP_example} \includegraphics[width=0.5\linewidth]{integer_LP_example} \begin{itemize} \item Goal: minimize $\tau_f - \tau_s$ \item Precedence constraints: \begin{itemize} \item Goal: minimize $\tau_f - \tau_s$ \item Precedence constraints: \subitem $\tau_s = 0$ \subitem $\tau_f \leq L_{max}$ \subitem $\tau_f - \tau_a \geq 1$ \subitem $\tau_f - \tau_b \geq 1$ \subitem $\tau_s - \tau_a \geq 0$ \subitem $\tau_s - \tau_b \geq 0$ \item Encoding of starting times: \item Encoding of starting times: \includegraphics[width=0.35\linewidth]{integer_LP_example_starting_times} \subitem $x_{a1}, \dots x_{a4} \in \{0,1\}$ (same for $b$) \subitem Only one can be $1$: $x_{a1} + \dots + x_{a4} = 1$ (same for $b$) \subitem $x_{a1} + 2x_{a2} + 3x_{a3} + 4x_{a4} = \tau_a$ \subitem Find the maximal time range by applying ASAP and ALAP ($l_i$ and $h_i$) and by estimating an $L_{max}$ \item Resource constraints for each point in time:\\ \item Resource constraints for each point in time:\\ $x_{a1} + x_{b1} \leq 1$, \quad $x_{a2} + x_{b2} \leq 1, \dots$ \subitem if a operation needs more than 1 timeslot, the resource constraints get more complicated. \end{itemize} \end{itemize} \subsection{Iterative Algorithms (10-56)} Iterative Algorithms consist of a set of indexed equations that are evaluated for all values of an index variable $l$ (e.g. signal flow graphs, marked graphs). Multiple representations are possible: \begin{itemize} \item Single \textcolor{red}{indexed equation} with constant index dependencies \subsection{Iterative Algorithms (10-56)} Iterative Algorithms consist of a set of indexed equations that are evaluated for all values of an index variable $l$ (e.g. signal flow graphs, marked graphs). Multiple representations are possible: \begin{itemize} \item Single \textcolor{red}{indexed equation} with constant index dependencies $$y[l] = au[l]+by[l-1]+cy[l-2]+dy[l-3]$$ \item Equivalent set of indexed equations \item Equivalent set of indexed equations \begin{equation*} \begin{alignedat}{1} x_1[l]&=au[l] \\ ... ... @@ -222,15 +222,15 @@ Iterative Algorithms consist of a set of indexed equations that are evaluated fo y[l]&=x_3[l]+by[l-1] \\ \end{alignedat} \end{equation*} \item \textcolor{red}{Extended sequence graph} $G_S=(V_S,E_S,d)$ \item \textcolor{red}{Marked graph}: \begin{center} \includegraphics[width=0.6\columnwidth]{arch1} \includegraphics[width=0.6\columnwidth]{arch2} \end{center} To each edge there is associated the index displacement \item \textcolor{red}{Marked graph}: \item \textcolor{red}{Extended sequence graph} $G_S=(V_S,E_S,d)$ \begin{center} \includegraphics[width=0.6\columnwidth]{arch2} \includegraphics[width=0.6\columnwidth]{arch1} \end{center} To each edge there is associated the index displacement \item \textcolor{red}{signal flow graph:} \begin{center} \includegraphics[width=0.6\columnwidth]{images/flowgraph.JPG} ... ... @@ -239,11 +239,11 @@ Iterative Algorithms consist of a set of indexed equations that are evaluated fo \begin{center} \includegraphics[width=0.6\columnwidth]{images/loop.JPG} \end{center} \end{itemize} \end{itemize} ($\to$ essentially a sequence graph is executed repeatedly) ~ \begin{definition}{ } ($\to$ essentially a sequence graph is executed repeatedly) ~ \begin{definition}{ } \begin{itemize} \item An \textcolor{red}{iteration} is the set of all operations necessary to compute all variables $x_i[l]$ for a fixed index $l$ \item The \textcolor{red}{iteration interval} $P$ is the time distance between two successive iterations of an iterative algorithm. ... ... @@ -252,9 +252,9 @@ Iterative Algorithms consist of a set of indexed equations that are evaluated fo \item In \textcolor{red}{functional pipelining}, there exist time instances where the operations of different iterations $l$ are executed simultaneously. \item In case of \textcolor{red}{loop folding}, starting and finishing times of an operation are in different physical iterations. \end{itemize} \end{definition} \textbf{Implementation} \begin{itemize} \end{definition} \textbf{Implementation} \begin{itemize} \item \textbf{Simple possibility:}edges with $d_ij>0$ are removed from the extended sequence graph. The resulting sequence graph is implemented using standard methods.\\ \includegraphics[width=\linewidth]{images/simple.JPG} \item \textbf{Functional pipelining:} Successive iterations overlap and higher throughput ($1/P$) is obtained\\ ... ... @@ -262,40 +262,39 @@ Iterative Algorithms consist of a set of indexed equations that are evaluated fo $\tau(f_j)-\tau(f_i)\geq w(f_i)-d_{ij}\cdot P, \forall (f_i,f_j)\in E_S$\\ with unlimited resources:\\ \includegraphics[width=\linewidth]{images/pipe.JPG} \end{itemize} \end{itemize} \textbf{Solving Synthesis Problem using Integer Linear Programming} \newline \begin{compactenum} \item Start with ILP formulation using simple sequence graph \item Use extended sequence graph, including displacements $d_{ij}$ (edge weights) \item ASAP and ALAP scheduling for upper and lower bounds $h_i,l_i$. Use only edges with $d_{ij}=0$ \item Guess a suitable iteration interval $P$. If this is not feasible, increase $P$ \item Replace equation 5 with $$\forall (v_i,v_j) \in E_S: \quad \tau(v_j)-\tau(v_i) \geq w(v_i)-d_{ij}\cdot P$$\\ proof on slide 10-65 \item Replace equation 6 with \subsubsection{Solving Synthesis Problem using Integer Linear Programming} \begin{compactenum} \item Start with ILP formulation using simple sequence graph \item Use extended sequence graph, including displacements $d_{ij}$ (edge weights) \item ASAP and ALAP scheduling for upper and lower bounds $h_i,l_i$. Use only edges with $d_{ij}=0$ \item Guess a suitable iteration interval $P$. If this is not feasible, increase $P$ \item Replace equation 5 with $$\forall (v_i,v_j) \in E_S: \quad \tau(v_j)-\tau(v_i) \geq w(v_i)-d_{ij}\cdot P$$\\ proof on slide 10-65 \item Replace equation 6 with \begin{equation*} \begin{alignedat}{1} &\forall v_k \in V_T: \quad \forall t: 1 \leq t \leq P: \\ &\sum_{\forall i: (v_i,v_k) \in E_R} \sum_{p'=0}^{w(v_i)-1} \sum_{\forall p: ~l_i\leq t-p'+pP\leq h_i} x_{i,t-p'+pP} \leq \alpha(v_k) \end{alignedat} \end{equation*} \end{compactenum}~\newline \end{compactenum}~\newline \subsection{Dynamic Voltage Scaling (DVS, 10-67)} Optimize energy in case of DVS using ILP: \begin{itemize} \item $|K|$ different voltage levels \item A task $v_i \in V_S$ can use one of the execution times $\forall k \in K: w_k(v_i)$ and corresponding energy $e_k(v_i)$ \item Deadlines $d(v_i)$ for each operation \item no resource constraints \end{itemize} ~ \begin{compactenum} \item Minimize $$\sum_{k \in K} \sum_{v_i \in V_S} y_{ik}\cdot e_k(v_i)$$ subjecto to the constraints 2-5 \item Binary variables: $$\forall v_i \in V_S, k \in K: \quad y_{ik} \in \{0,1\}$$ \item One voltage $k\in K$ chosen for each operation: $$\forall v_i \in V_S: \quad \sum_{k\in K} y_{ik} = 1$$ \item Precedence constraints: $$\forall(v_i,v_j) \in E_S: \quad \tau(v_j)-\tau(v_i) \geq \sum_{k \in K} y_{ik}\cdot w_k(v_i)$$ \item Guarantee of Deadlines: $$\forall v_i \in V_S: \quad \tau(v_i)+\sum_{k\in K} y_{ik}\cdot w_k(v_i) \leq d(v_i)$$ \end{compactenum} \subsection{Dynamic Voltage Scaling (DVS, 10-67)} Optimize energy in case of DVS using ILP: \begin{itemize} \item $|K|$ different voltage levels \item A task $v_i \in V_S$ can use one of the execution times $\forall k \in K: w_k(v_i)$ and corresponding energy $e_k(v_i)$ \item Deadlines $d(v_i)$ for each operation \item no resource constraints \end{itemize} ~ \begin{compactenum} \item Minimize $$\sum_{k \in K} \sum_{v_i \in V_S} y_{ik}\cdot e_k(v_i)$$ subjecto to the constraints 2-5 \item Binary variables: $$\forall v_i \in V_S, k \in K: \quad y_{ik} \in \{0,1\}$$ \item One voltage $k\in K$ chosen for each operation: $$\forall v_i \in V_S: \quad \sum_{k\in K} y_{ik} = 1$$ \item Precedence constraints: $$\forall(v_i,v_j) \in E_S: \quad \tau(v_j)-\tau(v_i) \geq \sum_{k \in K} y_{ik}\cdot w_k(v_i)$$ \item Guarantee of Deadlines: $$\forall v_i \in V_S: \quad \tau(v_i)+\sum_{k\in K} y_{ik}\cdot w_k(v_i) \leq d(v_i)$$ \end{compactenum}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!