mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-03-11 17:49:25 -05:00
fix(vol1): model_serving PDF build — Python cell and TikZ
- Remove duplicate indented block in resnet-spectrum-calc cell that caused IndentationError (partial EXPORTS + stray class-body lines). - Fix TikZ in fig-server-anatomy: add missing 'to' in brain path segments, remove stray/double commas in node and draw options.
This commit is contained in:
@@ -677,16 +677,6 @@ class ResNetServingSpectrum:
|
||||
cloud_name = ResNetServingSpectrum.cloud_name
|
||||
mobile_name = ResNetServingSpectrum.mobile_name
|
||||
tiny_name = ResNetServingSpectrum.tiny_name
|
||||
|
||||
tiny_model_mb_str = fmt(tiny_original_mb, precision=0)
|
||||
tiny_alt_mb_str = fmt(tiny_alt_mb, precision=1)
|
||||
tiny_inf_ms_str = f"{tiny_inf_ms}"
|
||||
tiny_throughput_str = "8"
|
||||
tiny_arena_kb_str = "320"
|
||||
tiny_sram_kb_str = "512"
|
||||
tiny_energy_mj_str = f"{tiny_energy_mj}"
|
||||
|
||||
# ┌── EXPORTS (Bridge to Text) ─────────────────────────────────────────────────
|
||||
cloud_model_mb_str = ResNetServingSpectrum.cloud_model_mb_str
|
||||
cloud_inf_b1_ms_str = ResNetServingSpectrum.cloud_inf_b1_ms_str
|
||||
cloud_inf_b16_ms_str = ResNetServingSpectrum.cloud_inf_b16_ms_str
|
||||
@@ -788,7 +778,7 @@ Every request traverses a multi-stage pipeline designed to maximize hardware thr
|
||||
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}
|
||||
LineA/.style = {violet!60,{Circle[line width=1.0pt,fill=white,length=5.5pt]}-,line width=1.5pt,shorten <=-3pt}
|
||||
}
|
||||
%laptop
|
||||
\tikzset{
|
||||
@@ -820,7 +810,7 @@ fill=\filllcolor!10,line width=\Linewidth,](EK)at(0,0.53){};
|
||||
% popuna (klipujemo unutar ivica)
|
||||
\begin{scope}
|
||||
\clip[] ($(4BL)+(\x,0)$) rectangle ++(\w,\h);
|
||||
\fill[gray!10]($(4BL)+(\x,0)$) rectangle ++(\w,\h*1);
|
||||
\fill[gray!10]($(4BL)+(\x,0)$) rectangle ++(\w,\h*1);
|
||||
\fill[fill=\filllcirclecolor]($(4BL)+(\x,0)$) rectangle ++(\w,\h*\Level);
|
||||
\end{scope}
|
||||
% kontura preko
|
||||
@@ -847,14 +837,14 @@ pics/gatewey/.style = {
|
||||
\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];
|
||||
\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);
|
||||
|
||||
\foreach\i in{0.15,0.3,0.45,0.6}{
|
||||
@@ -903,13 +893,13 @@ pics/cpu/.style = {
|
||||
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);
|
||||
to[out=160,in=80](-0.42,-0.15)to(-0.48,-0.7)to(0.07,-0.7)to(0.1,-0.5)
|
||||
to(-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)
|
||||
to(-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)
|
||||
@@ -921,7 +911,7 @@ to[out=240,in=130](-0.52,-0.1)to[out=300,in=240]cycle;
|
||||
(-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.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);
|
||||
@@ -946,9 +936,9 @@ 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]
|
||||
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)--
|
||||
\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,
|
||||
@@ -987,15 +977,15 @@ rectangle,rounded corners=2pt,minimum width=16mm,minimum height=5pt]at(0,0.5){};
|
||||
/channel/.cd,
|
||||
Depth/.store in=\Depth,
|
||||
Height/.store in=\Height,
|
||||
Width/.store in=\Width,
|
||||
Level/.store in=\Level,
|
||||
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,
|
||||
picname/.store in=\picname,
|
||||
filllcolor=BrownLine,
|
||||
filllcirclecolor=cyan!40,
|
||||
drawcolor=black,
|
||||
@@ -1005,14 +995,14 @@ rectangle,rounded corners=2pt,minimum width=16mm,minimum height=5pt]at(0,0.5){};
|
||||
Linewidth=0.5pt,
|
||||
Depth=1.3,
|
||||
Height=0.8,
|
||||
Width=1.1,
|
||||
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}};
|
||||
@@ -1023,7 +1013,7 @@ filllcolor=red!,Linewidth=1.5pt, filllcirclecolor=red!80}};
|
||||
\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}};
|
||||
@@ -1052,8 +1042,8 @@ filllcolor=BlueD!70!,Linewidth=0.75pt, filllcirclecolor=brown!20}};
|
||||
\draw[LineA](S2)--(NI);
|
||||
|
||||
\draw[LineA](S3)--++(210:1.15);
|
||||
\node[Box2,,right=0.55 of NI](RQT){Request\\Queue};
|
||||
|
||||
\node[Box2,right=0.55 of NI](RQT){Request\\Queue};
|
||||
|
||||
\node[Box2,right=0.4 of RQT](DBT){Dynamic\\Batcher};
|
||||
\draw[LineA](S4)--(DBT);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user