mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-03-11 17:49:25 -05:00
Updated figures in chapter 13
This commit is contained in:
@@ -679,32 +679,292 @@ Every request traverses a multi-stage pipeline designed to maximize hardware thr
|
||||
|
||||
::: {#fig-server-anatomy fig-env="figure" fig-pos="htb" fig-cap="**Inference Server Anatomy**: A modern inference server decouples network handling from accelerator execution through a staged pipeline. Each stage isolates a concern, from absorbing bursty traffic to forming efficient batches, so the hardware accelerator stays highly utilized despite irregular arrival patterns." fig-alt="Flowchart showing 6-stage inference server pipeline: Client to Network Ingress to Request Queue (cylinder) to Dynamic Batcher, then down to Inference Runner to Accelerator. Arrows connect stages sequentially."}
|
||||
```{.tikz}
|
||||
\begin{tikzpicture}[font=\small\usefont{T1}{phv}{m}{n}, node distance=1.2cm]
|
||||
\begin{tikzpicture}[font=\small\usefont{T1}{phv}{m}{n}]
|
||||
\tikzset{
|
||||
Box/.style={draw=BackLine, thick, rounded corners=2pt, align=center, minimum width=2.5cm, minimum height=1cm},
|
||||
Hardware/.style={Box, fill=GreenL, draw=GreenLine},
|
||||
Software/.style={Box, fill=BlueL, draw=BlueLine},
|
||||
Queue/.style={draw=OrangeLine, thick, shape=cylinder, shape border rotate=90, aspect=0.25, minimum width=1.5cm, minimum height=1.2cm, fill=OrangeL}
|
||||
Box/.style={draw=none,minimum width=20mm, minimum height=15mm, node distance=18mm},
|
||||
Arr/.style={-{Triangle[width=10pt,length=8pt]}, line width=5pt,cyan!40,shorten >=1pt, shorten <=2pt},
|
||||
Box2/.style={align=flush center, inner xsep=2pt,draw=OrangeLine,
|
||||
font=\footnotesize\usefont{T1}{phv}{m}{n},
|
||||
line width=0.75pt, rounded corners,fill=OrangeL!30, text width=16mm,
|
||||
minimum width=16mm, minimum height=10mm},
|
||||
LineA/.style = {violet!60,{Circle[line width=1.0pt,fill=white,length=5.5pt]}-,line width=1.5pt,shorten <=-3pt}
|
||||
}
|
||||
%laptop
|
||||
\tikzset{
|
||||
pics/laptop/.style = {
|
||||
code = {
|
||||
\pgfkeys{/channel/.cd, #1}
|
||||
\begin{scope}[shift={($(0,0)+(0,0)$)},scale=\scalefac,every node/.append style={transform shape}]
|
||||
\node[rounded corners=2pt,rectangle,minimum width=60,minimum height=37,
|
||||
fill=\filllcolor!60,line width=\Linewidth,draw=black](EKV)at(0,0.53){};
|
||||
%
|
||||
\node[draw=black,rounded corners=2pt,rectangle,minimum width=53,minimum height=30,
|
||||
fill=\filllcolor!10,line width=\Linewidth,](EK)at(0,0.53){};
|
||||
\coordinate(SM1)at($(EK.south west)+(0.15,0.5)$);
|
||||
\coordinate(SM2)at($(EK.south east)+(-1.1,0.5)$);
|
||||
\coordinate(OK1)at($(EK.220)+(0,0.7)$);
|
||||
\coordinate(OK2)at($(EK.240)+(0,0.7)$);
|
||||
\node[fill=black,inner sep=0pt,ellipse,minimum width=2pt,minimum height=3pt](OKO1)at(OK1){};
|
||||
\node[fill=black,inner sep=0pt,ellipse,minimum width=2pt,minimum height=3pt](OKO2)at(OK2){};
|
||||
\draw[line width=1.4pt](SM1)to [bend right=45](SM2);
|
||||
%%
|
||||
\coordinate(4BL)at($(EK.south west)+(0.95,0.3)$);
|
||||
\def\n{5} % broj boksova
|
||||
\def\w{0.12} % širina boksa (mm)
|
||||
\def\h{0.5} % visina boksa (mm)
|
||||
\def\gap{0.05} % razmak između boksova (mm)
|
||||
% niz boksova
|
||||
\foreach \i in {0,...,4} {
|
||||
\pgfmathsetmacro{\x}{\i*(\w+\gap)}
|
||||
% popuna (klipujemo unutar ivica)
|
||||
\begin{scope}
|
||||
\clip[] ($(4BL)+(\x,0)$) rectangle ++(\w,\h);
|
||||
\fill[gray!10]($(4BL)+(\x,0)$) rectangle ++(\w,\h*1);
|
||||
\fill[fill=\filllcirclecolor]($(4BL)+(\x,0)$) rectangle ++(\w,\h*\Level);
|
||||
\end{scope}
|
||||
% kontura preko
|
||||
\draw[line width=0.6pt,draw=black]($(4BL)+(\x,0)$) rectangle ++(\w,\h);
|
||||
}
|
||||
%
|
||||
\draw[fill=\filllcolor!60!black!30,line width=\Linewidth](-1.00,-0.1)--(1.0,-0.1)--(1.28,-0.6)--(-1.28,-0.6)--cycle;
|
||||
\draw[fill=\filllcolor!60!black!30,line width=\Linewidth](1.28,-0.6)--(-1.28,-0.6)arc[start angle=180, end angle=270, radius=4pt]--(1.14,-0.73)
|
||||
arc[start angle=270, end angle=355, radius=4pt]--cycle;
|
||||
\draw[fill=\filllcolor!30!black!10,line width=\Linewidth](-0.95,-0.17)--(0.95,-0.17)--(1.03,-0.34)--(-1.03,-0.34)--cycle;
|
||||
\draw[fill=\filllcolor!30!black!20,line width=\Linewidth](-0.16,-0.52)--(0.16,-0.52)--(0.14,-0.42)--(-0.14,-0.42)--cycle;
|
||||
\end{scope}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
\node[Box, fill=white] (client) {Client\\(Request)};
|
||||
\node[Software, right=of client] (ingress) {Network Ingress\\(HTTP/gRPC)};
|
||||
\node[Queue, right=of ingress] (queue) {Request\\Queue};
|
||||
\node[Software, right=of queue] (scheduler) {Dynamic\\Batcher};
|
||||
\node[Software, below=1.5cm of scheduler] (runtime) {Inference Runner\\(TensorRT/ONNX)};
|
||||
\node[Hardware, below=1.0cm of runtime] (gpu) {Accelerator\\(GPU/TPU)};
|
||||
\tikzset {
|
||||
pics/gatewey/.style = {
|
||||
code = {
|
||||
\pgfkeys{/channel/.cd, #1}
|
||||
\begin{scope}[local bounding box=GAT,scale=\scalefac, every node/.append style={transform shape}]
|
||||
\def\rI{4mm}
|
||||
\def\rII{2.8mm}
|
||||
\def\rIII{1.6mm}
|
||||
\draw[draw=\drawcolor,line width=0.8*\Linewidth](0,0)--(0,0.38)--(1.2,0.38)--(1.2,0)--cycle;
|
||||
\draw[draw=\drawcolor,line width=\Linewidth](0.6,0.4)--(0.6,0.9);
|
||||
|
||||
\draw[draw=\drawcolor, line width=\Linewidth] (0.6,0.9)+(60:\rI) arc[start angle=60, end angle=-60, radius=\rI];
|
||||
\draw[draw=\drawcolor, line width=\Linewidth] (0.6,0.9)+(50:\rII) arc[start angle=50, end angle=-50, radius=\rII];
|
||||
\draw[draw=\drawcolor, line width=\Linewidth] (0.6,0.9)+(30:\rIII) arc[start angle=30, end angle=-30, radius=\rIII];
|
||||
%
|
||||
\draw[draw=\drawcolor, line width=\Linewidth] (0.6,0.9)+(120:\rI) arc[start angle=120, end angle=240, radius=\rI];
|
||||
\draw[draw=\drawcolor, line width=\Linewidth] (0.6,0.9)+(130:\rII) arc[start angle=130, end angle=230, radius=\rII];
|
||||
\draw[draw=\drawcolor, line width=\Linewidth] (0.6,0.9)+(150:\rIII) arc[start angle=150, end angle=210, radius=\rIII];
|
||||
\fill[fill=\filllcolor](0.6,0.9)circle (1.5pt);
|
||||
|
||||
\draw[->, thick] (client) -- (ingress);
|
||||
\draw[->, thick] (ingress) -- (queue);
|
||||
\draw[->, thick] (queue) -- (scheduler);
|
||||
\draw[->, thick] (scheduler) -- (runtime);
|
||||
\draw[->, thick] (runtime) -- (gpu);
|
||||
\foreach\i in{0.15,0.3,0.45,0.6}{
|
||||
\fill[fill=\filllcolor](\i,0.19)circle (1.5pt);
|
||||
}
|
||||
|
||||
\fill[fill=\filllcolor](1,0.19)circle (2pt);
|
||||
\end{scope}
|
||||
}
|
||||
}
|
||||
}
|
||||
\tikzset {
|
||||
pics/cpu/.style = {
|
||||
code = {
|
||||
\pgfkeys{/channel/.cd, #1}
|
||||
\begin{scope}[local bounding box = CPU,scale=\scalefac, every node/.append style={transform shape}]
|
||||
\node[fill=\filllcolor,minimum width=66, minimum height=66,
|
||||
rounded corners=2,outer sep=2pt] (C1) {};
|
||||
\node[fill=\filllcirclecolor,minimum width=54, minimum height=54] (C2) {\bfseries\Large GPU};
|
||||
|
||||
\foreach \x/\y in {0.11/1,0.26/2,0.41/3,0.56/4,0.71/5,0.85/6}{
|
||||
\node[fill=\filllcolor,minimum width=4, minimum height=15,
|
||||
inner sep=0pt,anchor=south](GO\y)at($(C1.north west)!\x!(C1.north east)$){};
|
||||
}
|
||||
\foreach \x/\y in {0.11/1,0.26/2,0.41/3,0.56/4,0.71/5,0.85/6}{
|
||||
\node[fill=\filllcolor,minimum width=4, minimum height=15,
|
||||
inner sep=0pt,anchor=north](DO\y)at($(C1.south west)!\x!(C1.south east)$){};
|
||||
}
|
||||
\foreach \x/\y in {0.11/1,0.26/2,0.41/3,0.56/4,0.71/5,0.85/6}{
|
||||
\node[fill=\filllcolor,minimum width=15, minimum height=4,
|
||||
inner sep=0pt,anchor=east](LE\y)at($(C1.north west)!\x!(C1.south west)$){};
|
||||
}
|
||||
\foreach \x/\y in {0.11/1,0.26/2,0.41/3,0.56/4,0.71/5,0.85/6}{
|
||||
\node[fill=\filllcolor,minimum width=15, minimum height=4,
|
||||
inner sep=0pt,anchor=west](DE\y)at($(C1.north east)!\x!(C1.south east)$){};
|
||||
}
|
||||
\end{scope}
|
||||
}
|
||||
}
|
||||
}
|
||||
\tikzset{pics/brain/.style = {
|
||||
code = {
|
||||
\pgfkeys{/channel/.cd, #1}
|
||||
\begin{scope}[local bounding box=BRAIN,scale=\scalefac, every node/.append style={transform shape}]
|
||||
\fill[fill=\filllcolor!50](0.1,-0.5)to[out=0,in=180](0.33,-0.5)
|
||||
to[out=0,in=270](0.45,-0.38)to(0.45,-0.18)
|
||||
to[out=40,in=240](0.57,-0.13)to[out=110,in=310](0.52,-0.05)
|
||||
to[out=130,in=290](0.44,0.15)to[out=90,in=340,distance=8](0.08,0.69)
|
||||
to[out=160,in=80](-0.42,-0.15)to (-0.48,-0.7)to(0.07,-0.7)to(0.1,-0.5)
|
||||
(-0.10,-0.42)to[out=310,in=180](0.1,-0.5);
|
||||
\draw[draw=\drawcolor,line width=\Linewidth](0.1,-0.5)to[out=0,in=180](0.33,-0.5)
|
||||
to[out=0,in=270](0.45,-0.38)to(0.45,-0.18)
|
||||
to[out=40,in=240](0.57,-0.13)to[out=110,in=310](0.52,-0.05)
|
||||
to[out=130,in=290](0.44,0.15)to[out=90,in=340,distance=8](0.08,0.69)
|
||||
(-0.42,-0.15)to (-0.48,-0.7)
|
||||
(0.07,-0.7)to(0.1,-0.5)
|
||||
(-0.10,-0.42)to[out=310,in=180](0.1,-0.5);
|
||||
\draw[fill=\filllcolor,line width=\Linewidth](-0.3,-0.10)to(0.08,0.60)
|
||||
to[out=60,in=50,distance=3](-0.1,0.69)to[out=160,in=80](-0.26,0.59)to[out=170,in=90](-0.46,0.42)
|
||||
to[out=170,in=110](-0.54,0.25)to[out=210,in=150](-0.54,0.04)
|
||||
to[out=240,in=130](-0.52,-0.1)to[out=300,in=240]cycle;
|
||||
\draw[fill=\filllcolor,line width=\Linewidth]
|
||||
(-0.04,0.64)to[out=120,in=0](-0.1,0.69)(-0.19,0.52)to[out=120,in=330](-0.26,0.59)
|
||||
(-0.4,0.33)to[out=150,in=280](-0.46,0.42)
|
||||
%
|
||||
(-0.44,-0.03)to[bend left=30](-0.34,-0.04)
|
||||
(-0.33,0.08)to[bend left=40](-0.37,0.2) (-0.37,0.12)to[bend left=40](-0.45,0.14)
|
||||
(-0.26,0.2)to[bend left=30](-0.24,0.13)
|
||||
(-0.16,0.32)to[bend right=30](-0.27,0.3)to[bend right=30](-0.29,0.38)
|
||||
(-0.13,0.49)to[bend left=30](-0.04,0.51);
|
||||
|
||||
\draw[rounded corners=0.8pt,line width=\Linewidth,\drawcircle,-{Circle[fill=\filllcirclecolor,length=3.5pt]}](-0.23,0.03)--(-0.15,-0.03)--(-0.19,-0.18)--(-0.04,-0.28);
|
||||
\draw[rounded corners=0.8pt,line width=\Linewidth,\drawcircle,-{Circle[fill=\filllcirclecolor,length=3.5pt]}](-0.17,0.13)--(-0.04,0.05)--(-0.06,-0.06)--(0.14,-0.11);
|
||||
\draw[rounded corners=0.8pt,line width=\Linewidth,\drawcircle,-{Circle[fill=\filllcirclecolor,length=3.5pt]}](-0.12,0.23)--(0.31,0.0);
|
||||
\draw[rounded corners=0.8pt,line width=\Linewidth,\drawcircle,-{Circle[fill=\filllcirclecolor,length=3.5pt]}](-0.07,0.32)--(0.06,0.26)--(0.16,0.33)--(0.34,0.2);
|
||||
\draw[rounded corners=0.8pt,line width=\Linewidth,\drawcircle,-{Circle[fill=\filllcirclecolor,length=3.5pt]}](-0.01,0.43)--(0.06,0.39)--(0.18,0.51)--(0.31,0.4);
|
||||
\end{scope}
|
||||
}
|
||||
}
|
||||
}
|
||||
%inbox
|
||||
\tikzset{%
|
||||
pics/inbox/.style = {
|
||||
code = {
|
||||
\pgfkeys{/channel/.cd, #1}
|
||||
\begin{scope}[local bounding box=INBOX,scale=\scalefac, every node/.append style={transform shape}]
|
||||
\node[line width=\Linewidth,draw=\drawcolor,fill=\filllcolor!50,
|
||||
rectangle,rounded corners=3pt,minimum width=14mm,minimum height=10mm]at(0,0.3){};
|
||||
\node[line width=\Linewidth,draw=\drawcolor,fill=\filllcolor,
|
||||
rectangle,rounded corners=3pt,minimum width=15mm,minimum height=10mm]at(0,0.1){};
|
||||
\node[line width=\Linewidth,draw=\drawcolor,fill=\filllcolor!50,
|
||||
,rectangle,rounded corners=3pt,minimum width=17mm,minimum height=10mm]
|
||||
at(0,-0.1){};
|
||||
\draw[line width=\Linewidth,draw=\drawcolor,fill=\filllcirclecolor,,rounded corners=2pt](-0.92,0.05)--
|
||||
(-0.92,-0.78)--(0.92,-0.78)--(0.92,0.05)--(0.40,0.05)--(0.32,-0.2)--(-0.29,-0.2)--(-0.40,0.05)--cycle;
|
||||
|
||||
\node[single arrow, line width=\Linewidth,draw=black,fill=green!80!black!50, rotate=270,
|
||||
minimum width = 15pt, single arrow head extend=6pt,
|
||||
minimum height=10mm]at(0,0.5) {}; % length of arrow
|
||||
\end{scope}
|
||||
}
|
||||
}
|
||||
}
|
||||
%funnel
|
||||
\tikzset{%
|
||||
pics/funnel/.style = {
|
||||
code = {
|
||||
\pgfkeys{/channel/.cd, #1}
|
||||
\begin{scope}[local bounding box=FUNNEL,scale=\scalefac, every node/.append style={transform shape}]
|
||||
\draw[fill=\filllcolor!50,line width=\Linewidth,draw=\drawcolor](-0.12,-0.81)--(-0.19,-0.25)--(-0.7,0.41)--(0.7,0.41)--(0.19,-0.25)--(0.12,-0.81)--cycle;
|
||||
\draw[fill=\filllcolor!50,line width=\Linewidth,draw=\drawcolor](-0.19,-0.25)--(0.08,-0.25);
|
||||
\draw[fill=\filllcolor!50,line width=\Linewidth,draw=\drawcolor](0.16,-0.09)--(0.41,0.31);
|
||||
%
|
||||
\node[line width=\Linewidth,draw=\drawcolor,fill=\filllcolor!50,inner sep=1pt,
|
||||
rectangle,rounded corners=2pt,minimum width=16mm,minimum height=5pt]at(0,0.5){};
|
||||
%
|
||||
\foreach \i in{-0.5,0,0.5}{
|
||||
\node[single arrow, line width=0.8*\Linewidth,draw=black,fill=cyan!90!black!30, rotate=270,inner sep=1pt,
|
||||
minimum width =9pt, single arrow head extend=2pt,
|
||||
minimum height=3.5mm]at(\i,0.83) {}; % length of arrow
|
||||
}
|
||||
\node[single arrow,line width=0.8*\Linewidth,draw=black,fill=\filllcirclecolor, rotate=270,inner sep=1pt,
|
||||
minimum width =11pt, single arrow head extend=2pt,
|
||||
minimum height=4mm]at(0,-1.05) {}; % length of arrow
|
||||
\end{scope}
|
||||
}
|
||||
}
|
||||
}
|
||||
\pgfkeys{
|
||||
/channel/.cd,
|
||||
Depth/.store in=\Depth,
|
||||
Height/.store in=\Height,
|
||||
Width/.store in=\Width,
|
||||
Level/.store in=\Level,
|
||||
filllcirclecolor/.store in=\filllcirclecolor,
|
||||
filllcolor/.store in=\filllcolor,
|
||||
drawcolor/.store in=\drawcolor,
|
||||
drawcircle/.store in=\drawcircle,
|
||||
scalefac/.store in=\scalefac,
|
||||
Linewidth/.store in=\Linewidth,
|
||||
picname/.store in=\picname,
|
||||
filllcolor=BrownLine,
|
||||
filllcirclecolor=cyan!40,
|
||||
drawcolor=black,
|
||||
drawcircle=violet,
|
||||
scalefac=1,
|
||||
Level=0.52,
|
||||
Linewidth=0.5pt,
|
||||
Depth=1.3,
|
||||
Height=0.8,
|
||||
Width=1.1,
|
||||
picname=C
|
||||
}
|
||||
|
||||
\node[Box, fill=white](B1){};
|
||||
\pic[shift={(0,-0.10)}] at (B1){laptop={scalefac=0.67,picname=1,drawcolor=GreenD,
|
||||
filllcolor=GreenD!70!,Linewidth=0.75pt, filllcirclecolor=red!80}};
|
||||
|
||||
\node[Box, fill=white,right=of B1,minimum width=16mm](B2){};
|
||||
\pic[shift={(-0.68,-0.57)}] at (B2){gatewey={scalefac=1.1,picname=1,drawcolor=green!50!black,
|
||||
filllcolor=red!,Linewidth=1.5pt, filllcirclecolor=red!80}};
|
||||
|
||||
\node[Box, fill=white,right=of B2,minimum width=14mm](B3){};
|
||||
\pic[shift={(0,0.07)}] at (B3){brain={scalefac=1.0,picname=1,filllcolor=orange!30!, Linewidth=1pt}};
|
||||
|
||||
\node[Box, fill=white,right=of B3,minimum width=16mm](B4){};
|
||||
\pic[shift={(0,-0.06)}] at (B4){inbox={scalefac=0.7,picname=1,Linewidth=1.0pt,
|
||||
filllcolor=BrownL,drawcolor=black,filllcirclecolor=orange!70!yellow!80}};
|
||||
|
||||
\node[Box, fill=white,below=1 of B4,minimum width=17mm,minimum height=22mm](B5){};
|
||||
\pic[shift={(0,0.17)}] at (B5){funnel={scalefac=0.9,picname=1,Linewidth=1.0pt,
|
||||
filllcolor=BrownL,drawcolor=black,filllcirclecolor=green!70!yellow!80}};
|
||||
|
||||
\node[Box, fill=white,below=0.8 of B5,minimum width=17mm](B6){};
|
||||
\pic[shift={(0,0)}] at (B6){cpu={scalefac=0.4,picname=1,drawcolor=GreenD,
|
||||
filllcolor=BlueD!70!,Linewidth=0.75pt, filllcirclecolor=brown!20}};
|
||||
|
||||
\draw[Arr](B1)--(B2);
|
||||
\draw[Arr](B2)--(B3);
|
||||
\draw[Arr](B3)--(B4);
|
||||
\draw[Arr,shorten <=5pt](B4)--(B5);
|
||||
\draw[Arr](B5)--(B6);
|
||||
|
||||
\draw[violet,line width=1.5pt](B1.south west)--coordinate(S1)(B1.south east);
|
||||
\draw[violet,line width=1.5pt](B2.south west)--coordinate(S2)(B2.south east);
|
||||
\draw[violet,line width=1.5pt](B3.south west)--coordinate(S3)(B3.south east);
|
||||
\draw[violet,line width=1.5pt](B4.south west)--coordinate(S4)(B4.south east);
|
||||
\draw[violet,line width=1.5pt](B5.south west)--coordinate[pos=0.25](S5)(B5.north west);
|
||||
\draw[violet,line width=1.5pt](B6.south west)--coordinate(S6)(B6.north west);
|
||||
|
||||
\node[Box2,anchor=north,below= 0.6of S1](CR){Client\\(Request)};
|
||||
\draw[LineA](S1)--(CR);
|
||||
|
||||
\node[Box2,text width=25mm,right=0.75 of CR](NI){Network Ingress\\(HTTP/gRPC)};
|
||||
\draw[LineA](S2)--(NI);
|
||||
|
||||
\draw[LineA](S3)--++(210:1.15);
|
||||
\node[Box2,,right=0.55 of NI](RQT){Request\\Queue};
|
||||
|
||||
\node[Box2,right=0.4 of RQT](DBT){Dynamic\\Batcher};
|
||||
\draw[LineA](S4)--(DBT);
|
||||
|
||||
\node[Box2,left=of S5,text width=26mm](IRT){Inference Runner\\(TensorRT/ONNX)};
|
||||
\draw[LineA](S5)--(IRT);
|
||||
|
||||
\draw[LineA](S6)--++(180:1.0)coordinate(AC);
|
||||
\node[Box2,text width=26mm,left=of S6]{Accelerator\\(GPU/TPU)};
|
||||
% Labels
|
||||
\node[right=0.2cm of queue, font=\scriptsize\usefont{T1}{phv}{m}{n}, text=gray] {Request Buffering};
|
||||
\node[right=0.2cm of scheduler, font=\scriptsize\usefont{T1}{phv}{m}{n}, text=gray] {Throughput Opt.};
|
||||
\node[right=0.2cm of runtime, font=\scriptsize\usefont{T1}{phv}{m}{n}, text=gray] {Execution Opt.};
|
||||
|
||||
\node[above=0pt of B3, font=\scriptsize\usefont{T1}{phv}{m}{n}, text=gray] {Request Buffering};
|
||||
\node[above=0pt of B4, font=\scriptsize\usefont{T1}{phv}{m}{n}, text=gray] {Throughput Opt.};
|
||||
\node[right=12pt of B5.center, align=left,font=\scriptsize\usefont{T1}{phv}{m}{n}, text=gray] {Execution\\ Opt.};
|
||||
\end{tikzpicture}
|
||||
```
|
||||
:::
|
||||
@@ -1290,29 +1550,34 @@ Compare\index{I/O Overlap!compute pipelining} the two timing diagrams in @fig-se
|
||||
\definecolor{CPUColor}{RGB}{173,216,230}
|
||||
\definecolor{GPUColor}{RGB}{144,238,144}
|
||||
\definecolor{WaitColor}{RGB}{240,240,240}
|
||||
|
||||
% Serial Execution
|
||||
\node[anchor=west] at (0, 3.5) {\textbf{A. Serial Execution} (Low Utilization)};
|
||||
\draw[fill=CPUColor] (0, 2.5) rectangle (1.5, 3) node[midway] {Pre};
|
||||
\draw[fill=GPUColor] (1.5, 2.5) rectangle (3.0, 3) node[midway] {GPU};
|
||||
\draw[fill=WaitColor] (3.0, 2.5) rectangle (4.5, 3) node[midway, text=gray] {Idle};
|
||||
\draw[fill=CPUColor] (4.5, 2.5) rectangle (6.0, 3) node[midway] {Pre};
|
||||
\draw[fill=GPUColor] (6.0, 2.5) rectangle (7.5, 3) node[midway] {GPU};
|
||||
|
||||
% Overlapped Execution
|
||||
\node[anchor=west] at (0, 1.5) {\textbf{B. Pipelined Execution} (High Utilization)};
|
||||
% CPU Row
|
||||
\draw[fill=CPUColor] (0, 0.5) rectangle (1.5, 1) node[midway] {Pre 1};
|
||||
\draw[fill=CPUColor] (1.5, 0.5) rectangle (3.0, 1) node[midway] {Pre 2};
|
||||
\draw[fill=CPUColor] (3.0, 0.5) rectangle (4.5, 1) node[midway] {Pre 3};
|
||||
\draw[fill=CPUColor] (4.5, 0.5) rectangle (6.0, 1) node[midway] {Pre 4};
|
||||
|
||||
% GPU Row
|
||||
\draw[fill=GPUColor] (1.5, 0) rectangle (3.0, 0.5) node[midway] {GPU 1};
|
||||
\draw[fill=GPUColor] (3.0, 0) rectangle (4.5, 0.5) node[midway] {GPU 2};
|
||||
\draw[fill=GPUColor] (4.5, 0) rectangle (6.0, 0.5) node[midway] {GPU 3};
|
||||
\draw[fill=GPUColor] (6.0, 0) rectangle (7.5, 0.5) node[midway] {GPU 4};
|
||||
|
||||
\tikzset{
|
||||
Pre/.style={align=flush center, draw=black,
|
||||
font=\small\usefont{T1}{phv}{m}{n}, node distance=-1pt,
|
||||
line width=0.75pt, fill=cyan!20, text width=15mm,
|
||||
minimum width=16mm, minimum height=7mm},
|
||||
Gpu/.style={Pre,fill=GPUColor!60},
|
||||
Idle/.style={Pre,fill=WaitColor}
|
||||
}
|
||||
\node[Pre](R1){Pre};
|
||||
\node[Gpu,right=of R1](R2){GPU};
|
||||
\node[Idle,right=of R2](R3){Idle};
|
||||
\node[Pre,right=of R3](R4){Pre};
|
||||
\node[Gpu,right=of R4](R5){GPU};
|
||||
%
|
||||
\node[Pre,below=1.25of R1](R11){Pre1};
|
||||
\node[Pre,right=of R11](R12){Pre 2};
|
||||
\node[Pre,right=of R12](R13){Pre 3};
|
||||
\node[Pre,right=of R13](R14){Pre 4};
|
||||
%
|
||||
\node[Gpu,below=of R12](R21){GPU 1};
|
||||
\node[Gpu,right=of R21](R22){GPU 2};
|
||||
\node[Gpu,right=of R22](R23){GPU 3};
|
||||
\node[Gpu,right=of R23](R24){GPU 4};
|
||||
%
|
||||
\node[draw=none,fit=(R1)(R5)](T1){};
|
||||
\node[above=0pt of T1]{\textbf{A. Serial Execution} (Low Utilization)};
|
||||
\node[draw=none,fit=(R11)(R24)](T2){};
|
||||
\node[above=0pt of T2]{\textbf{B. Pipelined Execution} (High Utilization)};
|
||||
\end{tikzpicture}
|
||||
```
|
||||
:::
|
||||
|
||||
Reference in New Issue
Block a user