Apply some feedback

This commit is contained in:
Théophile Bastian 2024-12-05 12:06:59 +01:00
parent 47886bb07b
commit 626ce715da
5 changed files with 49 additions and 49 deletions

View file

@ -104,7 +104,7 @@
\end{center}
\end{frame}
\begin{frame}{Trois goulots d'étranglement}
\begin{frame}{Trois goulots d'étranglement étudiés}
\begin{tightitemize}{1em}
\pause
\begin{columns}[T]

View file

@ -75,19 +75,7 @@
% \end{itemize}
%\end{frame}
\begin{frame}{Code analyzers}
\begin{itemize}
\item That predict performance of a piece of assembly
\item Features microarchitectural models
\item Most often static analyzers
\item Predict at least the \emph{reverse-throughput} $\cyc{\kerK}$ of a
kernel $\kerK$ (cycles per iteration)
\item May derive further useful metrics, \eg{} bottlenecks, by
inspecting their model at will
\end{itemize}
\end{frame}
\begin{frame}{What can be analyzed?}
\begin{frame}{What do we analyze?}
Pieces of code referred as \alert{``microkernels''}:
\begin{itemize}
@ -100,6 +88,17 @@
Reasonable hypotheses for the category of codes worth optimizing this way!
\end{frame}
\begin{frame}{Code analyzers}
\begin{itemize}
\item Predict performance of a microkernel
\item Features microarchitectural models
\item Most often static analyzers
\item Predict at least the \alert{\emph{reverse-throughput}} of a kernel (cycles per iteration)
\item May derive further useful metrics, \eg{} bottlenecks, by
inspecting their model at will
\end{itemize}
\end{frame}
\begin{frame}{Existing code analyzers}
\begin{itemize}
\item Intel \alert{\iaca{}}: proprietary, Intel CPUs only. First

View file

@ -160,32 +160,34 @@ Gus & 0.00 & 20.37 & 30.59 & 0.82 & 188.04 \\
\textbf{Crucial difference:}
\end{center}
\newcommand{\lsthlA}[1]{\texttt{\color[HTML]{df018a}#1}}
\newcommand{\lsthlB}[1]{\texttt{\color[HTML]{d88900}#1}}
\begin{minipage}[t]{0.47\textwidth}
\begin{center}
\textbf{\color{red}Bad}
\textbf{{\color{red}Bad}\onslide<2->{: reduction}}
\end{center}
\vspace{-1em}
\begin{lstlisting}[language={[ANSI]C}]
for(c3)
tmp[c1] += A[c1][c3] * x[c3];
for((§\lsthlA{c3}§))
tmp[(§\lsthlB{c1}§)] += A[c1][c3] * x[c3];
\end{lstlisting}
\end{minipage}
\hfill\vrule\hfill
\begin{minipage}[t]{0.47\textwidth}
\begin{center}
\textbf{\color[HTML]{008f0c}Good}
\textbf{{\color[HTML]{008f0c}Good}\onslide<2->{: map}}
\end{center}
\vspace{-1em}
\begin{lstlisting}[language={[ANSI]C}]
for(c3)
A[c1][c3] += u1[c1] * v1[c3]
for(\lsthlA{c3}§))
A[c1][\lsthlA{c3}§)] += u1[c1] * v1[c3]
+ u2[c1] * v2[c3];
\end{lstlisting}
\end{minipage}
\pause{}
\begin{center}
\alert{\textbf{Dependencies through memory!}}
\onslide<3->{\alert{\textbf{Dependencies through memory!}}}
\end{center}
\end{frame}

View file

@ -4,9 +4,9 @@
\begin{minipage}[c]{0.35\textwidth}
\begin{lstlisting}[language={[x86masm]Assembler}, numbers=none]
0: mov (%rax), %rcx
0: mov (%rax), \alert{\reg{rcx}}§)
...
3: add %rcx, %rdx
3: add \alert{\reg{rcx}}§), %rdx
\end{lstlisting}
\end{minipage}\hfill
\begin{minipage}[c]{0.5\textwidth}
@ -17,7 +17,7 @@
\end{minipage}
\begin{center}
3 $\rightarrow$ 0 through \reg{rcx}
0 $\to$ 3 through \reg{rcx}
\end{center}
\end{frame}
@ -37,18 +37,17 @@ loop:
\end{minipage}\hfill
\begin{minipage}[c]{0.40\textwidth}
\begin{lstlisting}[language={[x86masm]Assembler}, numbers=none]
0,0: add %rcx, %rdx
...
0,3: mov (%rax), %rcx
1,0: add %rcx, %rdx
...
1,3: mov (%rax), %rcx
0: add %rcx, %rdx
...
3: mov (%rax), (§\alert{\reg{rcx}}§)
0: add (§\alert{\reg{rcx}}§), %rdx
...
3: mov (%rax), %rcx
\end{lstlisting}
\end{minipage}
\begin{center}
1,0 $\rightarrow$ 0,3 through \reg{rcx}\\
\ie{} \alert{loop-carried 1 $\rightarrow$ 3}
3 $\to$ 0 through \reg{rcx}, \alert{loop-carried}
\end{center}
\end{frame}
@ -56,9 +55,9 @@ loop:
\begin{frame}[fragile]{Dependencies, through memory}
\begin{minipage}[c]{0.30\textwidth}
\begin{lstlisting}[language={[x86masm]Assembler}, numbers=none]
mov %r10, 4(%rax)
mov %r10, \alert{4(\reg{rax})}§)
add $4, %rax
add (%rax), %rbx
add (§\alert{(\reg{rax})}§), %rbx
\end{lstlisting}
\end{minipage}\hfill
\begin{minipage}[c]{0.68\textwidth}
@ -124,7 +123,7 @@ int fibo(int* F, int n) {
\newcommand{\unk}{{\color{gray}?}}
\newcommand{\h}{\cellcolor[HTML]{D0ECFF}}
\newcommand{\w}{\cellcolor[HTML]{d6bf86}}
\newcommand{\dep}[1]{{\color{red}$\veryshortarrow$\,#1}}
\newcommand{\dep}[1]{{\color{red}#1\,$\to$}}
\begin{columns}
\column{\dimexpr\paperwidth-8pt}
\centering
@ -158,28 +157,28 @@ int fibo(int* F, int n) {
Start & \unk& \unk&& \unk & \unk & \unk & \unk & \unk & \\
\midrule
\pause{}
0,0 & 100 & 200 && 200\h& \unk & \unk & \unk & \unk & \\
0 & 100 & 200 && 200\h& \unk & \unk & \unk & \unk & \\
\pause{}
0,1 & 100 & 376 && 200 & 176\h& \unk & \unk & \unk & \\
1 & 100 & 376 && 200 & 176\h& \unk & \unk & \unk & \\
\pause{}
0,2 & 100 & 376 && 200 & 176 & 376\w& \unk & \unk & \\
2 & 100 & 376 && 200 & 176 & 376\w& \unk & \unk & \\
\pause{}
0,3 & \alert{104} & 376 && 200 & 176 & 376 & \unk & \unk & \\
0,4 & 104 & 376 && 200 & 176 & 376 & \unk & \unk & \\
3 & \alert{104} & 376 && 200 & 176 & 376 & \unk & \unk{} & \\{} % Oskour.
4 & 104 & 376 && 200 & 176 & 376 & \unk & \unk & \\
\midrule
\pause{}
1,0 & 104 & \alert{176} && 200 & 176\h& 376 & \unk & \unk & \\
0 & 104 & \alert{176} && 200 & 176\h& 376 & \unk & \unk & \\
\pause{}
1,1 & 104 & \alert{552} && 200 & 176 & 376\h& \unk & \unk & \dep{-1,2}\\
1 & 104 & \alert{552} && 200 & 176 & 376\h& \unk & \unk & \dep{-1,2}\\
\pause{}
1,2 & 104 & 552 && 200 & 176 & 376 & 552\w& \unk & \\
2 & 104 & 552 && 200 & 176 & 376 & 552\w& \unk & \\
\midrule
\pause{}
2,0 & 108 & \alert{376} && 200 & 176 & 376\h& 552 & \unk & \dep{-2,2}\\
0 & 108 & \alert{376} && 200 & 176 & 376\h& 552 & \unk & \dep{-2,2}\\
\pause{}
2,1 & 108 & \alert{928} && 200 & 176 & 376 & 552\h& \unk & \dep{-1,2}\\
1 & 108 & \alert{928} && 200 & 176 & 376 & 552\h& \unk & \dep{-1,2}\\
\pause{}
2,2 & 108 & 928 && 200 & 176 & 376 & 552 & 928\w &\\
2 & 108 & 928 && 200 & 176 & 376 & 552 & 928\w &\\
\bottomrule{}
\end{tabular}
\end{minipage}\hfill
@ -269,7 +268,7 @@ int fibo(int* F, int n) {
\multirow{2}{*}{Full} & \uica{} & 29.59 & 18.26 & 0.58\\
& + \staticdeps{} & 19.15 & 14.44 & 0.81\\
\midrule
\multirow{2}{*}{Pruned} & \uica{} & 18.42 & 11.96 & 0.80\\
\multirow{2}{*}{Trim} & \uica{} & 18.42 & 11.96 & 0.80\\
& + \staticdeps{} & 18.77 & 12.18 & 0.80\\
\bottomrule
\end{tabular}

View file

@ -15,7 +15,7 @@
captionpos=b, % sets the caption-position to bottom
commentstyle=\color{color_comment}, % comment style
% deletekeywords={...}, % if you want to delete keywords from the given language
% escapeinside={\%*}{*)}, % if you want to add LaTeX within your code
escapeinside={(§}{§)}, % if you want to add LaTeX within your code
extendedchars=true, % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
frame=none, % adds a frame around the code
keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)