additional plot, and short script to do a nonvectorized benchmark (like they...
This commit is contained in:
committed by
salijagic
parent
fcff5b0389
commit
df4fb4a154
+43
-2
@@ -59,7 +59,7 @@ plt.savefig("analysis/fig_tracks.png", dpi=170, bbox_inches="tight")
|
||||
bars = [
|
||||
("baseline", "variant_baseline"),
|
||||
("AVX2 (double)", "variant_inlining_7_SoA_AVX2"),
|
||||
("AVX-512 (double)", "variant_avx512_1"),
|
||||
("AVX-512 (double)", "variant_AVX512_1"),
|
||||
("+ polyexp", "variant_inlining_8_SoA_AVX512_polyexp_moreavx"),
|
||||
("+ float", "variant_float_inlining_SoA_AVX512_polyexp_moreavx"),
|
||||
("+ rsqrt & ILP", "variant_float_inlining_SoA_AVX512_polyexp_moreavx_ilp_2_rsqrt_morersqrt"),
|
||||
@@ -101,7 +101,7 @@ for pk,t in [(SCALAR,"scalar (4)"),(PEAK_D,"double (16)"),(PEAK_F,"float (32)")]
|
||||
I5000 = df[(df.variant=="variant_baseline") & (df.n==5000)]["I"].values[0]
|
||||
pts = [
|
||||
("variant_baseline", "#7a7a7a"),
|
||||
("variant_avx512_1", "#2f9e8f"),
|
||||
("variant_AVX512_1", "#2f9e8f"),
|
||||
("variant_inlining_8_SoA_AVX512_polyexp_moreavx", "#e08a1e"),
|
||||
("variant_float_inlining_SoA_AVX512_polyexp_moreavx", "#c0436a"),
|
||||
("variant_float_inlining_SoA_AVX512_polyexp_moreavx_ilp_2_rsqrt_morersqrt", maroon),
|
||||
@@ -140,5 +140,46 @@ ax.legend(frameon=False, fontsize=10)
|
||||
plt.tight_layout()
|
||||
plt.savefig("analysis/fig_exp.png", dpi=170, bbox_inches="tight")
|
||||
|
||||
# plot 5: the milestone ladder as lines (this is plot0 + line1, line2, ... for the doc).
|
||||
# one line per relevant optimization step across n, baseline at the bottom.
|
||||
# unlike fig_tracks this includes the scalar steps so you can see where each jump comes from.
|
||||
milestones = [
|
||||
("variant_baseline", "baseline", "#7a7a7a", "-"),
|
||||
("variant_cutoff_callsite", "+ cutoff (best scalar)", "#9e8f2f", "-"),
|
||||
("variant_inlining_7_SoA_AVX2", "AVX2 (double)", "#3b6fb0", "--"),
|
||||
("variant_inlining_7_SoA_AVX2_polyexp", "+ polyexp (double)", "#2f9e8f", "--"),
|
||||
("variant_inlining_8_SoA_AVX512_polyexp_moreavx", "AVX-512 (double)", "#2f5d9e", "-"),
|
||||
("variant_float_inlining_SoA_AVX2_polyexp", "float AVX2 + polyexp", "#e58aa6", "--"),
|
||||
("variant_float_inlining_SoA_AVX2_polyexp_rsqrt_loopopt", "float AVX2 + rsqrt", "#e08a1e", "--"),
|
||||
("variant_float_inlining_SoA_AVX512_polyexp_moreavx", "float AVX-512", "#c0436a", "-"),
|
||||
("variant_float_inlining_SoA_AVX512_polyexp_moreavx_ilp_2_rsqrt_morersqrt","float AVX-512 + rsqrt + ILP (best)", maroon, "-"),
|
||||
]
|
||||
|
||||
fig, ax = plt.subplots(figsize=(9.5,5.2))
|
||||
for v,lab,c,ls in milestones:
|
||||
x,y = getline(v)
|
||||
if len(x) == 0: # variant not in results.csv -> skip instead of crashing
|
||||
print("skip (not in csv):", v)
|
||||
continue
|
||||
ax.plot(x, y, ls, color=c, marker="o", ms=4, lw=2.4 if c==maroon else 1.7, label=lab)
|
||||
|
||||
for yv,t in [(PEAK_D,"double peak (16)"), (PEAK_F,"float peak (32)")]:
|
||||
ax.axhline(yv, ls=":", color="#999", lw=1.2)
|
||||
ax.text(52, yv*1.03, t, fontsize=9.5, color="#888")
|
||||
|
||||
ax.set_xscale("log"); ax.set_yscale("log")
|
||||
ax.set_xticks([50,100,200,500,1000,2000,5000,10000])
|
||||
ax.set_xticklabels(["50","100","200","500","1k","2k","5k","10k"])
|
||||
ax.set_yticks([1,2,4,8,16,32]); ax.set_yticklabels(["1","2","4","8","16","32"])
|
||||
ax.set_xlim(46,13000); ax.set_ylim(0.8,40)
|
||||
ax.set_xlabel("number of pedestrians n")
|
||||
ax.set_ylabel("performance [flops/cycle]")
|
||||
ax.grid(color="#e9e9e9")
|
||||
ax.spines["top"].set_visible(False); ax.spines["right"].set_visible(False)
|
||||
ax.legend(fontsize=8.5, loc="upper left", ncol=2, framealpha=.95)
|
||||
plt.tight_layout()
|
||||
plt.savefig("analysis/fig_milestones.png", dpi=170, bbox_inches="tight")
|
||||
|
||||
|
||||
#plt.show()
|
||||
print("done")
|
||||
Reference in New Issue
Block a user