mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
See https://github.com/pytorch/pytorch/pull/129751#issue-2380881501. Most changes are auto-generated by linter. You can review these PRs via: ```bash git diff --ignore-all-space --ignore-blank-lines HEAD~1 ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/129754 Approved by: https://github.com/ezyang
25 lines
625 B
Python
25 lines
625 B
Python
import pandas
|
|
|
|
|
|
df = pandas.read_csv("perf.csv")
|
|
|
|
ops = pandas.unique(df["operator"])
|
|
nops = len(ops)
|
|
pivot_op_shape = df.pivot_table(
|
|
values="time", index=["operator", "shape"], columns=["fuser"]
|
|
)
|
|
pivot_speedups = (pivot_op_shape.T / pivot_op_shape["eager"]).T
|
|
|
|
import matplotlib.pyplot as plt
|
|
|
|
|
|
plt.rcParams["figure.figsize"] = (20, 100)
|
|
fig, axs = plt.subplots(nops)
|
|
plt.subplots_adjust(hspace=0.5)
|
|
for idx, op in enumerate(ops):
|
|
op_speedups = pivot_speedups.T[op].T
|
|
op_speedups.plot(ax=axs[idx], kind="bar", ylim=(0, 2), rot=45)
|
|
axs[idx].set_title(op)
|
|
axs[idx].set_xlabel("")
|
|
plt.savefig("perf.png")
|