Skip to content

Commit

Permalink
Fixup timing plots
Browse files Browse the repository at this point in the history
  • Loading branch information
mmore500 committed Oct 10, 2020
1 parent 20851aa commit c10ed70
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 3 deletions.
3 changes: 2 additions & 1 deletion microbenchmarks/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ bench:
./script/fixup_and_validate.sh
python3 script/consolidate.py $$(find SignalGP signalgp-lite -name '*.json')
for f in *run_type=iteration*.csv; do \
python3 script/graph.py $$f; \
python3 script/graph.py $f; \
python3 script/graph_speedup.py $f; \
done
./script/upload.sh
2 changes: 1 addition & 1 deletion microbenchmarks/script/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def facet(df):
df,
col='Library',
margin_titles="true",
sharex=False,
sharey=False,
)


Expand Down
75 changes: 75 additions & 0 deletions microbenchmarks/script/graph_speedup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from keyname import keyname as kn
from slugify import slugify
import subprocess
import sys
from iterpop import iterpop as ip
import numpy as np

__, filename = sys.argv

nproc = int(subprocess.check_output(['nproc']))

df = pd.read_csv(filename)

for k, v in kn.unpack(filename).items():
df[k] = v

df = df.astype({ 'num agents' : int })

df = df.groupby(['Library', 'Implementation', 'num agents',]).mean().reset_index()

vanilla = df[df['Implementation'] == 'vanilla']
lite = df[df['Implementation'] == 'lite']

ratio = pd.DataFrame()
ratio['Library'] = vanilla['Library']
ratio['num agents'] = vanilla['num agents']

ratio['Wall Speedup'] = (
np.array( vanilla['Wall Nanoseconds'] )
/ np.array( lite['Wall Nanoseconds'] )
)

ratio['CPU Speedup'] = (
np.array( vanilla['CPU Nanoseconds'] )
/ np.array( lite['CPU Nanoseconds'] )
)

sns.barplot(
data=ratio,
x='num agents',
y='Wall Speedup',
hue='Library',
)

plt.savefig(
kn.pack({
'measurement' : slugify('Wall Speedup'),
'ext' : '.png',
}),
transparent=True,
dpi=300,
)

plt.clf()

sns.barplot(
data=ratio,
x='num agents',
y='CPU Speedup',
hue='Library',
)

plt.savefig(
kn.pack({
'measurement' : slugify('CPU Speedup'),
'ext' : '.png',
}),
transparent=True,
dpi=300,
)

plt.clf()
2 changes: 1 addition & 1 deletion microbenchmarks/script/upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ OSF_PATH="microbenchmarks/context=${CONTEXT}/nnode=${NNODE}+nproc=${NPROC}/time=

set -o xtrace

for f in $(find . -name "*.json"); do
for f in $(find . -type f -name "*.json" -o -name "*.png" -o -name "*.csv"); do
osf -u mmore500.login@gmail.com -p j8pge upload $f $OSF_PATH/$f;
done

0 comments on commit c10ed70

Please sign in to comment.