diff --git a/figures/cpu_matvec.pdf b/figures/cpu_matvec.pdf index 15033d1..4c96524 100644 Binary files a/figures/cpu_matvec.pdf and b/figures/cpu_matvec.pdf differ diff --git a/figures/cpu_matvec.png b/figures/cpu_matvec.png index ff4d215..8bdfeb8 100644 Binary files a/figures/cpu_matvec.png and b/figures/cpu_matvec.png differ diff --git a/figures/kernels.pdf b/figures/kernels.pdf index d41b663..275de95 100644 Binary files a/figures/kernels.pdf and b/figures/kernels.pdf differ diff --git a/figures/mlfmm_bw.pdf b/figures/mlfmm_bw.pdf index f23cd58..a1f21a5 100644 Binary files a/figures/mlfmm_bw.pdf and b/figures/mlfmm_bw.pdf differ diff --git a/figures/mlfmm_bw.png b/figures/mlfmm_bw.png index e1b81ca..a0dfea9 100644 Binary files a/figures/mlfmm_bw.png and b/figures/mlfmm_bw.png differ diff --git a/figures/mlfmm_minsky.pdf b/figures/mlfmm_minsky.pdf index 77f336c..bc199b9 100644 Binary files a/figures/mlfmm_minsky.pdf and b/figures/mlfmm_minsky.pdf differ diff --git a/figures/mlfmm_minsky.png b/figures/mlfmm_minsky.png index 9fe34ae..d7fbef8 100644 Binary files a/figures/mlfmm_minsky.png and b/figures/mlfmm_minsky.png differ diff --git a/figures/plots.py b/figures/plots.py index bf70f41..7dc514c 100644 --- a/figures/plots.py +++ b/figures/plots.py @@ -1,40 +1,60 @@ import numpy as np import seaborn as sns import matplotlib.pyplot as plt - sns.set(style="white", context="talk") - plt.rcdefaults() - DPI=600 +def autolabel(ax, rect): + """ + Attach a text label above each bar displaying its height + """ + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width()/2., 1.05*height, + '%d' % int(height), + ha='center', va='bottom') + path = 'figures/cpu_matvec' fig, ax = plt.subplots() systems = ('BW (32T)', "Minsky (160T)") mlfmm = (8.65e4, 4.84e4) total = (1.2e5, 5.77e4) x_pos = np.arange(len(systems)) -ax.bar(x_pos, mlfmm, color='gray') -ax.bar(x_pos, [i-j for i,j in zip(total, mlfmm)], color='lightgray', bottom=mlfmm ) + +ax.bar(x_pos, mlfmm, color='darkgray', label='MLFMM') +ax.bar(x_pos, [i-j for i,j in zip(total, mlfmm)], color='lightgray', bottom=mlfmm, label='Other Operations') ax.set_xticks(x_pos) ax.set_xticklabels(systems) ax.set_ylabel("Execution Time (ms)") -# ax.set_title('How fast do you want to go today?') +handles, labels = ax.get_legend_handles_labels() +ax.legend(handles, labels) plt.savefig(path+'.pdf') plt.savefig(path+'.png', dpi=DPI) print path + path='figures/mlfmm_bw' -width=0.25 +width=0.33 fig, ax = plt.subplots() systems = ('1T', "32T", "1 GPU" ,"4 GPU", "16 GPU") mlfmm = (1.50e6, 8.64e4, 2.78e4, 7.01e3, 1.89e3) num = (45,45,45,45,47) x_pos = np.arange(len(systems)) -ax.bar([p-width/2 for p in x_pos], [i/j for i,j in zip(mlfmm,num)], color='darkgray', log=True, width=0.25) +rects = ax.bar([p-width/2 for p in x_pos], [i/j for i,j in zip(mlfmm,num)], color='darkgray', log=True, width=width) +autolabel(ax, rects[0]) +autolabel(ax, rects[1]) +autolabel(ax, rects[2]) +autolabel(ax, rects[3]) +autolabel(ax, rects[4]) +ax.set_ylim(1,8e4) ax2=ax.twinx() -ax2.bar([p+width/2 for p in x_pos], [mlfmm[0] / i for i in mlfmm], color='lightgray', log=True, width=0.25) +rects = ax2.bar([p+width/2 for p in x_pos], [mlfmm[0] / i for i in mlfmm], color='lightgray', log=True, width=width) +autolabel(ax2, rects[1]) +autolabel(ax2, rects[2]) +autolabel(ax2, rects[3]) +autolabel(ax2, rects[4]) +ax2.set_ylim(1,1.5e3) ax.set_xticks(x_pos) ax.set_xticklabels(systems) ax.set_ylabel("Per-MLFMM Execution Time (ms)") @@ -43,73 +63,37 @@ plt.savefig(path+'.pdf') plt.savefig(path+'.png', dpi=DPI) print path + + path="figures/mlfmm_minsky" -# fig, ax = plt.subplots() -# systems = ('1T', "160T", "1 GPU" ,"4 GPU") -# mlfmm = (1.25e6, 4.71e4, 5.22e3, 1.29e3) -# num = (44,44,44,44) -# x_pos = np.arange(len(systems)) -# ax.bar(x_pos, [i/j for i,j in zip(mlfmm,num)], color='gray', log=True) -# ax.set_xticks(x_pos) -# ax.set_xticklabels(systems) -# ax.set_ylabel("Per-MLFMM Execution Time (ms)") -# plt.ylim([1, 1e5]) -# # ax.set_title('How fast do you want to go today?') -# plt.savefig(path+'.pdf') -# plt.savefig(path+'.png', dpi=DPI) -# print path - - -# fig, ax = plt.subplots() -# systems = ('1T', "160T", "1 GPU" ,"4 GPU") -# mlfmm = [1.25e6, 4.71e4, 5.22e3, 1.29e3] -# num = (44,44,44,44) -# x_pos = [0,1,2,3] -# sns.barplot(x_pos + x_pos, -# [i/j for i, j in zip(mlfmm,num)] + [mlfmm[0] / i for i in mlfmm], -# ["Time", "Time", "Time", "Time", "Speedup", "Speedup", "Speedup", "Speedup"], -# palette="BuGn_d", ax=ax, log=True) - -width = 10 +width = 0.33 fig, ax = plt.subplots() systems = ('1T', "160T", "1 GPU" ,"4 GPU") mlfmm = [1.25e6, 4.84e4, 5.22e3, 1.29e3] num = (44,44,44,44) -x_pos = [0,1,2,3] -sns.barplot(x_pos, - [i/j for i, j in zip(mlfmm,num)], - color="DarkGray", ax=ax, log=True) -ax.set_ylabel("Per-MLFMM Execution Time (ms)") - -ax2 = ax.twinx() -# ax2.set_ylim((0,300)) -sns.barplot(x_pos, - [mlfmm[0] / i for i in mlfmm], - color="LightGray", ax=ax2, log=True) -ax2.set_ylabel("Speedup over 1T") - - -new_width = 0.25 -for bar in ax.patches: - center = bar.get_x() + bar.get_width() / 2 - bar.set_width(new_width) - bar.set_x(center - new_width) - -for bar in ax2.patches: - center = bar.get_x() + bar.get_width() / 2 - bar.set_width(new_width) - bar.set_x(center) - - +x_pos = np.arange(len(systems)) +rects = ax.bar([p-width/2 for p in x_pos], [i/j for i,j in zip(mlfmm,num)], color='darkgray', log=True, width=width) +autolabel(ax, rects[0]) +autolabel(ax, rects[1]) +autolabel(ax, rects[2]) +autolabel(ax, rects[3]) +ax.set_ylim(1,8e4) +ax2=ax.twinx() +rects = ax2.bar([p+width/2 for p in x_pos], [mlfmm[0] / i for i in mlfmm], color='lightgray', log=True, width=width) +autolabel(ax2, rects[1]) +autolabel(ax2, rects[2]) +autolabel(ax2, rects[3]) +ax2.set_ylim(1,1.5e3) ax.set_xticks(x_pos) ax.set_xticklabels(systems) - -# plt.ylim([1, 1e5]) -# ax.set_title('How fast do you want to go today?') +ax.set_ylabel("Per-MLFMM Execution Time (ms)") +ax2.set_ylabel("Speedup over 1T") plt.savefig(path+'.pdf') plt.savefig(path+'.png', dpi=DPI) print path + + fig, ax = plt.subplots() systems = ['BW 32T', "Minsky 160T", "BW 4 GPU" ,"Minsky 4 GPU"] p2m = (127.10, 72.10749, 7.73, 1.604) @@ -126,6 +110,8 @@ l2l_ratio = [i/j for i,j in zip(l2l, total)] l2p_ratio = [i/j for i,j in zip(l2p, total)] p2p_ratio = [i/j for i,j in zip(p2p, total)] + + path = 'figures/kernels' x_pos = np.arange(len(systems)) ax.bar(x_pos, p2p_ratio, color='0', label='p2p')