In [1]:
%matplotlib inline
import pandas as pd
import random
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns


/opt/conda/lib/python3.5/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
/opt/conda/lib/python3.5/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')

In [33]:
df = pd.read_csv('all_results.csv')

In [3]:
df.head()


Out[3]:
machine limits benchmark lower_is_better result
0 192.168.140.81 with_limits crafty NaN 59.09
1 192.168.140.81 with_limits stream-copy NaN 3943.46
2 192.168.140.81 with_limits stream-add NaN 4111.40
3 192.168.140.81 with_limits stream-scale NaN 3749.34
4 192.168.140.81 with_limits stream-triad NaN 4210.84

In [4]:
df['machine'].unique()


Out[4]:
array(['192.168.140.81', '192.168.140.85', 'dwill.soe.ucsc.edu',
       'nibbler.soe.ucsc.edu', 'issdm-12'], dtype=object)

In [5]:
df['benchmark'].unique()


Out[5]:
array(['crafty', 'stream-copy', 'stream-add', 'stream-scale',
       'stream-triad', 'c-ray', 'stressng-cpu-ackermann',
       'stressng-cpu-bitops', 'stressng-cpu-callfunc',
       'stressng-cpu-cdouble', 'stressng-cpu-cfloat',
       'stressng-cpu-clongdouble', 'stressng-cpu-correlate',
       'stressng-cpu-crc16', 'stressng-cpu-decimal32',
       'stressng-cpu-decimal64', 'stressng-cpu-decimal128',
       'stressng-cpu-dither', 'stressng-cpu-djb2a', 'stressng-cpu-double',
       'stressng-cpu-euler', 'stressng-cpu-explog', 'stressng-cpu-fft',
       'stressng-cpu-fibonacci', 'stressng-cpu-float',
       'stressng-cpu-fnv1a', 'stressng-cpu-gamma', 'stressng-cpu-gcd',
       'stressng-cpu-gray', 'stressng-cpu-hamming', 'stressng-cpu-hanoi',
       'stressng-cpu-hyperbolic', 'stressng-cpu-idct',
       'stressng-cpu-int128', 'stressng-cpu-int64', 'stressng-cpu-int32',
       'stressng-cpu-int16', 'stressng-cpu-int8',
       'stressng-cpu-int128float', 'stressng-cpu-int128double',
       'stressng-cpu-int128longdouble', 'stressng-cpu-int128decimal32',
       'stressng-cpu-int128decimal64', 'stressng-cpu-int128decimal128',
       'stressng-cpu-int64float', 'stressng-cpu-int64double',
       'stressng-cpu-int64longdouble', 'stressng-cpu-int32float',
       'stressng-cpu-int32double', 'stressng-cpu-int32longdouble',
       'stressng-cpu-jenkin', 'stressng-cpu-jmp', 'stressng-cpu-ln2',
       'stressng-cpu-longdouble', 'stressng-cpu-loop',
       'stressng-cpu-matrixprod', 'stressng-cpu-nsqrt',
       'stressng-cpu-omega', 'stressng-cpu-parity', 'stressng-cpu-phi',
       'stressng-cpu-pi', 'stressng-cpu-pjw', 'stressng-cpu-prime',
       'stressng-cpu-psi', 'stressng-cpu-queens', 'stressng-cpu-rand',
       'stressng-cpu-rand48', 'stressng-cpu-rgb', 'stressng-cpu-sdbm',
       'stressng-cpu-sieve', 'stressng-cpu-sqrt', 'stressng-cpu-trig',
       'stressng-cpu-union', 'stressng-cpu-zeta', 'stressng-cpu-af-alg',
       'stressng-cpu-atomic', 'stressng-cpu-bsearch', 'stressng-cpu-cpu',
       'stressng-cpu-crypt', 'stressng-cpu-hsearch',
       'stressng-cpu-longjmp', 'stressng-cpu-lsearch', 'stressng-cpu-numa',
       'stressng-cpu-opcode', 'stressng-cpu-qsort', 'stressng-cpu-str',
       'stressng-cpu-stream', 'stressng-cpu-tsearch',
       'stressng-cpu-vecmath', 'stressng-cpu-wcs',
       'stressng-cpu-cache-cache', 'stressng-cpu-cache-icache',
       'stressng-memory-atomic', 'stressng-memory-context',
       'stressng-memory-full', 'stressng-memory-lockbus',
       'stressng-memory-malloc', 'stressng-memory-matrix',
       'stressng-memory-memcpy', 'stressng-memory-memfd',
       'stressng-memory-mincore', 'stressng-memory-null',
       'stressng-memory-pipe', 'stressng-memory-remap',
       'stressng-memory-stack', 'stressng-memory-stackmmap',
       'stressng-memory-str', 'stressng-memory-tlb-shootdown',
       'stressng-memory-vm', 'stressng-memory-vm-rw',
       'stressng-memory-zero', 'stressng-matrix-add',
       'stressng-matrix-div', 'stressng-matrix-frobenius',
       'stressng-matrix-mult', 'stressng-matrix-prod',
       'stressng-matrix-sub', 'stressng-matrix-hadamard',
       'stressng-matrix-trans', 'stressng-string-index',
       'stressng-string-rindex', 'stressng-string-strcasecmp',
       'stressng-string-strcat', 'stressng-string-strchr',
       'stressng-string-strcoll', 'stressng-string-strcmp',
       'stressng-string-strcpy', 'stressng-string-strlen',
       'stressng-string-strncasecmp', 'stressng-string-strncat',
       'stressng-string-strncmp', 'stressng-string-strrchr',
       'stressng-string-strxfrm', 'stressng-cpu-rdrand',
       'stressng-cpu-tsc', 'stressng-memory-oom-pipe'], dtype=object)

In [18]:
df['limits'].unique()


Out[18]:
array(['with_limits', 'no_limits'], dtype=object)

In [34]:
df.fillna(True, inplace=True)

In [35]:
%run normalize.py

In [36]:
df = obtain_speedup(df, 'issdm-12')

In [49]:
df.head()


Out[49]:
benchmark base_result machine limits lower_is_better result speedup
0 crafty 74.23 192.168.140.81 with_limits True 59.09 1.256219
1 crafty 74.23 192.168.140.81 with_limits True 60.79 1.221089
2 crafty 74.23 192.168.140.81 with_limits True 59.25 1.252827
3 crafty 74.23 192.168.140.85 with_limits True 66.64 1.113896
4 crafty 74.23 192.168.140.85 with_limits True 67.10 1.106259

In [71]:
machine = '192.168.140.81'
subdf = df[df["machine"] == machine]

In [72]:
sns.boxplot(subdf.speedup, groupby=subdf.limits)


/opt/conda/lib/python3.5/site-packages/seaborn/categorical.py:2125: UserWarning: The boxplot API has been changed. Attempting to adjust your arguments for the new API (which might not work). Please update your code. See the version 0.6 release notes for more info.
  warnings.warn(msg, UserWarning)
Out[72]:
<matplotlib.axes._subplots.AxesSubplot at 0x7faa618e4358>

The above might look like it shows that with limits we get lower/higher variability, but we need to normalize speedups w.r.t. the max/min values of each 'limits' group, otherwise this is an optical illusion


In [73]:
subdf['speedup_normalized'] = subdf.apply(
  lambda x:
    (x['result'] - subdf[subdf['limits'] == x['limits']]['speedup'].mean()) /
    (subdf[subdf['limits'] == x['limits']]['speedup'].max() -
     subdf[subdf['limits'] == x['limits']]['speedup'].min()),
  axis=1
)


/opt/conda/lib/python3.5/site-packages/ipykernel/__main__.py:7: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy

In [77]:
subdf.head()


Out[77]:
benchmark base_result machine limits lower_is_better result speedup speedup_normalized
0 crafty 74.23 192.168.140.81 with_limits True 59.09 1.256219 0.107382
1 crafty 74.23 192.168.140.81 with_limits True 60.79 1.221089 0.110778
2 crafty 74.23 192.168.140.81 with_limits True 59.25 1.252827 0.107702
12 crafty 74.23 192.168.140.81 no_limits True 26.26 2.826733 0.104758
17 stream-copy 2781.70 192.168.140.81 with_limits True 3943.46 1.417644 7.866462

In [75]:
sns.boxplot(subdf.speedup_normalized, groupby=subdf.limits)


/opt/conda/lib/python3.5/site-packages/seaborn/categorical.py:2125: UserWarning: The boxplot API has been changed. Attempting to adjust your arguments for the new API (which might not work). Please update your code. See the version 0.6 release notes for more info.
  warnings.warn(msg, UserWarning)
Out[75]:
<matplotlib.axes._subplots.AxesSubplot at 0x7faa617fbe48>

In [76]:
subdf[subdf['speedup'] > 25]


Out[76]:
benchmark base_result machine limits lower_is_better result speedup speedup_normalized
1671 stressng-memory-memfd 1343.897469 192.168.140.81 with_limits False 2.886764 465.537699 -0.004885
1672 stressng-memory-memfd 1343.897469 192.168.140.81 with_limits False 2.681308 501.209659 -0.005295
1673 stressng-memory-memfd 1343.897469 192.168.140.81 with_limits False 2.679100 501.622735 -0.005300
1683 stressng-memory-memfd 1343.897469 192.168.140.81 no_limits False 6.192943 217.004657 0.011856

In [ ]: