Add image for CNN
This commit is contained in:
61
images/cnn.tex
Normal file
61
images/cnn.tex
Normal file
@@ -0,0 +1,61 @@
|
||||
\begin{tikzpicture}
|
||||
|
||||
% Matrix
|
||||
% \node[draw,outer sep=0,minimum width=25mm,minimum height=6mm,fill=black ] (m00) {w[0,0:15]};
|
||||
% \node[draw,outer sep=0,minimum width=25mm,minimum height=6mm,fill=black,below=0 of m00 ] (m10) {w[1,0:15]};
|
||||
|
||||
\newcommand{\inputelement}[2]{\node [draw=blue!50,minimum size=8mm,fill=blue!20](#2){#1};}
|
||||
|
||||
\matrix (matrix) [matrix of nodes,row sep=-\pgflinewidth,column sep=-\pgflinewidth] {
|
||||
\inputelement{1}{i00} & \inputelement{0}{i01} & \inputelement{0}{i02} & \inputelement{1}{i03} & \inputelement{0}{i04} \\
|
||||
\inputelement{0}{i10} & \inputelement{1}{i11} & \inputelement{1}{i12} & \inputelement{0}{i13} & \inputelement{1}{i14} \\
|
||||
\inputelement{1}{i20} & \inputelement{0}{i21} & \inputelement{0}{i22} & \inputelement{1}{i23} & \inputelement{0}{i24} \\
|
||||
\inputelement{0}{i30} & \inputelement{1}{i31} & \inputelement{0}{i32} & \inputelement{0}{i33} & \inputelement{1}{i34} \\
|
||||
\inputelement{0}{i40} & \inputelement{0}{i41} & \inputelement{1}{i42} & \inputelement{1}{i43} & \inputelement{1}{i44} \\
|
||||
};
|
||||
\node [text=blue!70,below=0 of matrix] {\small Input Matrix};
|
||||
|
||||
\newcommand{\kernelelement}[2]{\node [draw=red!50,minimum size=9mm,fill=red!20](#2){#1};}
|
||||
|
||||
\matrix (kernel) [matrix of nodes,anchor=center,row sep=-\pgflinewidth,column sep=-\pgflinewidth] at (i12.south east) {
|
||||
\kernelelement{0}{k00} & \kernelelement{1}{k01} \\
|
||||
\kernelelement{1}{k10} & \kernelelement{1}{k11} \\
|
||||
};
|
||||
|
||||
\node [text=red!70,fill=white,below=0 of kernel] {\small Filter Matrix};
|
||||
|
||||
\draw[-latex,red!60,line width=0.5mm] (k01.south east) -- ++(1,0);
|
||||
|
||||
\matrix (matrix1) [matrix of nodes,right=1 of matrix,row sep=-\pgflinewidth,column sep=-\pgflinewidth] {
|
||||
\inputelement{1}{ib12} & \inputelement{0}{ib13} \\
|
||||
\inputelement{0}{ib22} & \inputelement{1}{ib23} \\
|
||||
};
|
||||
\node [text=blue!70,below=0 of matrix1] {\small Input Batch};
|
||||
|
||||
\node[right=3mm of matrix1] (prod) {*};
|
||||
|
||||
\matrix (kernel1) [matrix of nodes,right=3mm of prod,row sep=-\pgflinewidth,column sep=-\pgflinewidth] {
|
||||
\kernelelement{0}{kb00} & \kernelelement{1}{kb01} \\
|
||||
\kernelelement{1}{kb10} & \kernelelement{1}{kb11} \\
|
||||
};
|
||||
\node [text=red!70,below=0 of kernel1] {\small Filter/Kernel};
|
||||
|
||||
\node[right=3mm of kernel1] (eq) {=};
|
||||
|
||||
\newcommand{\outelement}[2]{\node [draw,minimum size=5mm,inner sep=0,outer sep=0](#2){\small #1};}
|
||||
|
||||
\matrix (output) [matrix of nodes,right=3mm of eq,row sep=-\pgflinewidth,column sep=-\pgflinewidth] {
|
||||
\outelement{1}{o00} & \outelement{2}{o01} & \outelement{1}{o02} & \outelement{1}{o03} \\
|
||||
\outelement{2}{o10} & \outelement{1}{o11} & \outelement{1}{o12} & \outelement{0}{o13} \\
|
||||
\outelement{0}{o20} & \outelement{0}{o21} & \outelement{0}{o22} & \outelement{0}{o23} \\
|
||||
\outelement{0}{o30} & \outelement{0}{o31} & \outelement{0}{o32} & \outelement{0}{o33} \\
|
||||
};
|
||||
\node [below=0 of output] {\small Output Matrix};
|
||||
|
||||
\draw[dashed] (ib13.north east) -- (kb00.north west);
|
||||
\draw[dashed] (ib23.south east) -- (kb10.south west);
|
||||
|
||||
\draw[dashed] (kb01.north east) -- (o12.north);
|
||||
\draw[dashed] (kb11.south east) -- (o12.south);
|
||||
|
||||
\end{tikzpicture}
|
||||
24
main.tex
24
main.tex
@@ -4,8 +4,13 @@
|
||||
\usepackage[style=verbose-ibid]{biblatex}
|
||||
\usepackage{datetime}
|
||||
\usepackage{tabularray}
|
||||
\usepackage{tikz}
|
||||
\usepackage[inkscapeversion=1]{svg}
|
||||
|
||||
\usetikzlibrary{fit}
|
||||
\usetikzlibrary{positioning}
|
||||
\usetikzlibrary{matrix}
|
||||
|
||||
\addbibresource{references.bib}
|
||||
|
||||
\setbeamerfont{footnote}{size=\tiny}
|
||||
@@ -63,8 +68,8 @@
|
||||
\begin{frame}{Workloads for PIM}
|
||||
Fully connected neural network layers:
|
||||
\begin{itemize}
|
||||
\item Large weight matrix - does not fit onto cache
|
||||
\item No data reuse - cache is useless
|
||||
\item Large weight matrix -\alert{does not fit onto cache}
|
||||
\item No data reuse - \alert{cache is useless}
|
||||
\end{itemize}
|
||||
\begin{figure}
|
||||
\includesvg[width=0.6\textwidth]{images/dnn}
|
||||
@@ -74,12 +79,13 @@
|
||||
\begin{frame}{Workloads for PIM}
|
||||
Convolutional layers:
|
||||
\begin{itemize}
|
||||
\item Small filter matrix - does fit onto cache
|
||||
\item Excessive data reuse - cache is useful
|
||||
\item Small filter matrix - \alert{does fit onto cache}
|
||||
\item Excessive data reuse - \alert{cache is useful}
|
||||
\end{itemize}
|
||||
\begin{figure}
|
||||
TODO Tikz Image
|
||||
% \includesvg[width=0.6\textwidth]{images/dnn}
|
||||
\begin{figure}
|
||||
\input{images/cnn}
|
||||
\end{figure}
|
||||
\end{figure}
|
||||
\end{frame}
|
||||
|
||||
@@ -387,4 +393,10 @@
|
||||
\tableofcontents
|
||||
\end{frame}
|
||||
|
||||
\begin{frame}{Memory Layout}
|
||||
\begin{figure}
|
||||
\includesvg[width=\textwidth]{images/complete_layout.svg}
|
||||
\end{figure}
|
||||
\end{frame}
|
||||
|
||||
\end{document}
|
||||
|
||||
Reference in New Issue
Block a user