Skip to content
Snippets Groups Projects
Verified Commit 29bf1aa9 authored by Joshua Balthasar Kobschätzki's avatar Joshua Balthasar Kobschätzki :speech_balloon:
Browse files

chore: add draft for outline and updated benchmark ingest script

parent a441accd
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,9 @@ import sys ...@@ -9,6 +9,9 @@ import sys
filename_pattern = re.compile( filename_pattern = re.compile(
r"(?P<job>[0-9]+)\.(?P<type>cpp-bench.)?(?P<partition>[^.]+).bench.txt" r"(?P<job>[0-9]+)\.(?P<type>cpp-bench.)?(?P<partition>[^.]+).bench.txt"
) )
query_pattern = re.compile(
r"^(?P<query>Q[0-9].[0-9]) +\| +(?P<run>[0-9]) +\| +(?P<duration>[0-9]+\.[0-9]+) +(?P<unit>\w+)$"
)
def init_db(db: sqlite3.Connection): def init_db(db: sqlite3.Connection):
...@@ -87,6 +90,19 @@ def main(ingest: pathlib.Path, db: sqlite3.Connection): ...@@ -87,6 +90,19 @@ def main(ingest: pathlib.Path, db: sqlite3.Connection):
(bench_id,) = bench_id (bench_id,) = bench_id
benches[bench] = bench_id benches[bench] = bench_id
# create or get cpp compiler
cpp_compiler = db.execute(
"select id from compilers where name = 'cpp-ref'"
).fetchone()
if cpp_compiler is None:
(cpp_compiler,) = db.execute(
"insert into compilers (name) values (?) returning id",
["cpp-ref"],
).fetchone()
print(f"Fetched [c] {cpp_compiler}")
db.commit()
compilers["cpp-ref"] = cpp_compiler
for filename in os.listdir(ingest): for filename in os.listdir(ingest):
match = filename_pattern.search(filename) match = filename_pattern.search(filename)
...@@ -103,6 +119,22 @@ def main(ingest: pathlib.Path, db: sqlite3.Connection): ...@@ -103,6 +119,22 @@ def main(ingest: pathlib.Path, db: sqlite3.Connection):
if match.get("type") is not None: if match.get("type") is not None:
bench = benches["benchmark-cpp"] bench = benches["benchmark-cpp"]
# set compiler based on bench
compiler_name = "adaptive"
if match.get("type") is not None:
compiler_name = "cpp-ref"
compiler = compilers.get(compiler_name)
if compiler is None:
(compiler,) = db.execute(
"insert into compilers (name) values (?) returning id",
[compiler_name],
).fetchone()
print(f"Fetched [c] {compiler}")
db.commit()
compilers[compiler_name] = compiler
# figure out partition # figure out partition
partition_name = match["partition"] partition_name = match["partition"]
...@@ -121,14 +153,51 @@ def main(ingest: pathlib.Path, db: sqlite3.Connection): ...@@ -121,14 +153,51 @@ def main(ingest: pathlib.Path, db: sqlite3.Connection):
print(f"Fetched [p] {partition}") print(f"Fetched [p] {partition}")
partitions[partition_name] = partition partitions[partition_name] = partition
# TODO: parse file iter by iter
print(f"Handling file for {partition} on {bench}") print(f"Handling file for {partition} on {bench}")
fd = open(ingest / filename) fd = open(ingest / filename)
content = fd.read() content = fd.read()
print(content.split("||")[2])
for line in content.splitlines():
match = query_pattern.search(line)
if match is not None:
match = match.groupdict()
print(f"Handling line {line}")
query_name = match["query"].replace(".", "-").lower()
print(f"Handling query {query_name}")
# fetch or insert query
query = queries.get(query_name)
if query is None:
(query,) = db.execute(
"insert into queries (name) values (?) returning id",
[query_name],
).fetchone()
print(f"Fetched [q] {query}")
db.commit()
queries[query_name] = query
try:
if match["run"] != "0":
db.execute(
"insert into measurements (compiler, query, partition, bench, duration, unit, iter_count) values (?, ?, ?, ?, ?, ?, ?)",
[
compiler,
query,
partition,
bench,
float(match["duration"]),
match["unit"],
1,
],
)
print("inserted value")
else:
print("discard warmup")
except Exception as e:
print(f"Failed to insert row: {e}")
fd.close() fd.close()
db.commit() db.commit()
......
No preview for this file type
\documentclass{beamer} \documentclass[draft]{beamer}
\usepackage[T1]{fontenc} \usepackage[T1]{fontenc}
\usepackage[german]{babel} \usepackage[german,english]{babel}
\usepackage{tikz,pgfplots,verbatim} \usepackage{tikz,pgfplots,verbatim}
\usepackage{listings}
\definecolor{GrayCodeBlock}{RGB}{64, 160, 43}
\definecolor{BlackText}{RGB}{76, 79, 105}
\definecolor{RedTypename}{RGB}{210, 15, 57}
\definecolor{GreenString}{RGB}{96,172,57}
\definecolor{PurpleKeyword}{RGB}{136, 57, 239}
\definecolor{GrayComment}{RGB}{64, 160, 43}
\definecolor{GoldDocumentation}{RGB}{180,165,45}
\lstdefinelanguage{rust}
{
columns=fullflexible,
keepspaces=true,
frame=single,
framesep=0pt,
framerule=0pt,
framexleftmargin=4pt,
framexrightmargin=4pt,
framextopmargin=5pt,
framexbottommargin=3pt,
xleftmargin=4pt,
xrightmargin=4pt,
backgroundcolor=\color{GrayCodeBlock},
basicstyle=\ttfamily\color{BlackText},
keywords={
true,false,
unsafe,async,await,move,
use,pub,crate,super,self,mod,
struct,enum,fn,const,static,let,mut,ref,type,impl,dyn,trait,where,as,
break,continue,if,else,while,for,loop,match,return,yield,in
},
keywordstyle=\color{PurpleKeyword},
ndkeywords={
bool,u8,u16,u32,u64,u128,i8,i16,i32,i64,i128,char,str,
Self,Option,Some,None,Result,Ok,Err,String,Box,Vec,Rc,Arc,Cell,RefCell,HashMap,BTreeMap,
macro_rules
},
ndkeywordstyle=\color{RedTypename},
comment=[l][\color{GrayComment}\slshape]{//},
morecomment=[s][\color{GrayComment}\slshape]{/*}{*/},
morecomment=[l][\color{GoldDocumentation}\slshape]{///},
morecomment=[s][\color{GoldDocumentation}\slshape]{/*!}{*/},
morecomment=[l][\color{GoldDocumentation}\slshape]{//!},
morecomment=[s][\color{RedTypename}]{\#![}{]},
morecomment=[s][\color{RedTypename}]{\#[}{]},
stringstyle=\color{GreenString},
string=[b]"
}
\newcommand{\code}[1]{\lstinline[language=rust]{#1}}
\usetheme[sectionpage=none]{metropolis} % Use metropolis theme \usetheme[sectionpage=none]{metropolis} % Use metropolis theme
\title{PPDS Präsentation} \title{PPDS Presentation}
\date{\today} \date{\today}
\author{Elias Engel and Joshua Kobschätzki} \author{Elias Engel and Joshua Kobschätzki}
\institute{PPDS Sommersemester 2024} \institute{PPDS SoSe 2024}
\section{Übersicht} \section{Overview}
\begin{document} \begin{document}
\maketitle \maketitle
\section{Lernergebnisse} \section{Architecture}
\begin{frame}[fragile]
\note{2 Min}
\frametitle{\secname: AdaptiveCompiler}
\begin{itemize}
\item Compiling \code{struct PlanNode} $\to$ \code{Box<dyn ONC>}
\begin{itemize}
\item[$\to$] Translates PlanNode into IR
\pause
\item[$\to$] optimized in passes
\begin{enumerate}
\item Predicate
\item Unify
\pause
\item Pushdown Projection
\pause
\item Projection Fuse
\end{enumerate}
\pause
\item[$\to$] translated into operators, who may opportunistically use SIMD
\pause
\item[$\to$] (optional) SIMD operators use an intermediate ONC layer, \verb|ChunkedONC|
\end{itemize}
\end{itemize}
\end{frame}
\section{Benchmark results}
\begin{frame}
\note{2 Min}
\frametitle{\secname}
TODO
\end{frame}
\section{Learning Outcomes}
\begin{frame}[fragile]{\secname} \begin{frame}[fragile]{\secname}
\begin{itemize} \begin{itemize}
\item { \item {
\verb|std::simd|, High-level SIMD ist suboptimal \verb|std::simd|, High-level SIMD is suboptimal
\begin{itemize} \begin{itemize}
\item Kosten der Abstraktion hoch \item Abstraction cost was too high
\item Optimierung von skalaren Teilen oder SIMD per intrinsics ist effektiver \item Optimising of scalar code via SIMD intrinsics is significantly more effective
\item Mikroarchitekturen haben sehr unterschiedliche Charakteristiken \item Does not adapt well across microarchitectures
\note{Implied here, high level SIMD can't accurately reflect these and is a compromise}
\end{itemize} \end{itemize}
} }
\item ONC ist nicht gut vektorisierbar \item ONC interface is not well suitable for vectorization
\begin{itemize} \begin{itemize}
\item Design des Interfaces/ der Datenstrukturen elementar \item Vectorization requires certain data structure layouts (columnar)
\item Vectorization of ONC has a fixed overhead (unpacking)
\end{itemize} \end{itemize}
\end{itemize} \end{itemize}
\end{frame} \end{frame}
\section{Herausforderungen}
\begin{frame}
\end{frame}
\begin{frame}[standout] \begin{frame}[standout]
Danke für ihre Aufmerksamkeit\\ Thank you for your Attention
Raum für Fragen
\end{frame} \end{frame}
\section*{Backup Slides} \section*{Backup Slides}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment