First plotting scripts
This commit is contained in:
@@ -6,8 +6,8 @@ class Configuration:
|
|||||||
name: str
|
name: str
|
||||||
workload: str
|
workload: str
|
||||||
executable: Path
|
executable: Path
|
||||||
pim: bool
|
|
||||||
level: str
|
level: str
|
||||||
|
pim: bool
|
||||||
frequency: str = "3GHz"
|
frequency: str = "3GHz"
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
|
|||||||
38
pim_plots.py
38
pim_plots.py
@@ -1,35 +1,35 @@
|
|||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
|
import seaborn as sns
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
df = pd.read_csv("pim_results.csv")
|
df = pd.read_csv("pim_results.csv")
|
||||||
|
|
||||||
frequency_filter = df["frequency"] == "3GHz"
|
|
||||||
|
|
||||||
workloads = df["workload"].unique()
|
workloads = df["workload"].unique()
|
||||||
|
|
||||||
fig, ax = plt.subplots()
|
sns.set_theme()
|
||||||
|
|
||||||
width = 0.25
|
def calc_speedup(x):
|
||||||
index = 0
|
return x.iat[0] / x.iat[1]
|
||||||
|
|
||||||
# for workload in workloads:
|
for workload in df["workload"].unique():
|
||||||
for level in df["level"].unique():
|
workload_filter = df["workload"] == workload
|
||||||
level_filter = df["level"] == level
|
|
||||||
|
|
||||||
for pim in [False, True]:
|
filtered_df = df[workload_filter]
|
||||||
workload_filter = df["workload"] == "vadd"
|
preprocessed_df = filtered_df.groupby(["workload", "level", "frequency"], as_index=False).agg({"ticks": calc_speedup}).rename(columns={"ticks":"speedup"})
|
||||||
|
|
||||||
filtered_df = df[level_filter & workload_filter & frequency_filter]
|
# print(preprocessed_df)
|
||||||
print(filtered_df)
|
# preprocessed_df.to_csv("plot.csv", index=False)
|
||||||
|
|
||||||
x = np.arange(len(filtered_df))
|
g = sns.catplot(
|
||||||
|
data=preprocessed_df, kind="bar",
|
||||||
|
x="level", y="speedup", hue="frequency",
|
||||||
|
palette="dark", alpha=.6, height=6
|
||||||
|
)
|
||||||
|
|
||||||
offset = 6*width * index
|
g.despine(left=True)
|
||||||
print(x+offset)
|
g.set_axis_labels("", "Speedup")
|
||||||
bars = ax.bar(x + offset, "ticks", width, data=filtered_df, label=level)
|
g.set(title=workload)
|
||||||
# ax.bar_label(bars, padding=2)
|
g.legend.set_title("")
|
||||||
index += 1
|
|
||||||
|
|
||||||
ax.legend(loc="upper left")
|
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|||||||
@@ -52,18 +52,23 @@ workloads = [
|
|||||||
# "gemv_layers",
|
# "gemv_layers",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
systems = [
|
||||||
|
"HBM",
|
||||||
|
"PIM-HBM",
|
||||||
|
]
|
||||||
|
|
||||||
configurations: list[Configuration] = []
|
configurations: list[Configuration] = []
|
||||||
|
|
||||||
for frequency in ["3GHz", "100GHz"]:
|
for frequency in ["3GHz", "100GHz"]:
|
||||||
for level in ["X1", "X2", "X3", "X4"]:
|
for level in ["X1", "X2", "X3", "X4"]:
|
||||||
for pim in [False, True]:
|
for system in systems:
|
||||||
for workload in workloads:
|
for workload in workloads:
|
||||||
if workload == "gemv_layers" and level != "X4":
|
if workload == "gemv_layers" and level != "X4":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
executable = workload
|
executable = workload
|
||||||
|
|
||||||
if pim:
|
if system == "HBM":
|
||||||
executable = f"classic_{workload}"
|
executable = f"classic_{workload}"
|
||||||
|
|
||||||
executable = (
|
executable = (
|
||||||
@@ -78,8 +83,8 @@ for frequency in ["3GHz", "100GHz"]:
|
|||||||
f"{workload}_{level}_{frequency}",
|
f"{workload}_{level}_{frequency}",
|
||||||
workload,
|
workload,
|
||||||
executable.as_posix(),
|
executable.as_posix(),
|
||||||
pim,
|
|
||||||
level,
|
level,
|
||||||
|
system == "PIM-HBM",
|
||||||
frequency,
|
frequency,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user