Skip to content

Commit

Permalink
add images to plot over time
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed May 23, 2023
1 parent de26556 commit 93a4728
Show file tree
Hide file tree
Showing 7 changed files with 1,905 additions and 1,830 deletions.
3 changes: 3 additions & 0 deletions google/autoscale/run1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ I didn't get to multiple instance types, or even removing nodes (I guess I got t
day). This is interesting because note that 40 seconds is quite a bit slower than approximately 25 that I saw before.
So I think when we plan new experiments we want to test these larger batches, and for different instance types.

I also looked at adding/removing nodes (in order) for at least the size 1, and
it didn't seem to matter. I suspect this won't be the case when the clusters get much
larger, but I don't know.

## Next Steps

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,654 changes: 1,827 additions & 1,827 deletions google/autoscale/run1/img/results-df.csv

Large diffs are not rendered by default.

78 changes: 75 additions & 3 deletions google/autoscale/run1/plot_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def plot_outputs(raw, plotname, ext="pdf", outdir=None):
"direction",
"iteration",
"seconds",
"key", # key tells us the from -> to node
]

# Let's first organize distributions of times
Expand All @@ -51,13 +52,31 @@ def plot_outputs(raw, plotname, ext="pdf", outdir=None):
experiment, name, iteration = runid.split(os.sep)
increment = int(experiment.split("-")[-1])
direction = experiment.split("-")[-2]
machine_type = item['machine_type']
machine_type = item["machine_type"]

for key, seconds in item["times"].items():
if key in ["create_cluster", "delete_cluster"]:
datum = [experiment, name, machine_type, increment, key, iteration, seconds]
datum = [
experiment,
name,
machine_type,
increment,
key,
iteration,
seconds,
key,
]
else:
datum = [experiment, name, machine_type, increment, direction, iteration, seconds]
datum = [
experiment,
name,
machine_type,
increment,
direction,
iteration,
seconds,
key,
]
data.append(datum)

# Assemble the data frame, index is the runids
Expand Down Expand Up @@ -205,6 +224,59 @@ def plot_outputs(raw, plotname, ext="pdf", outdir=None):
ylabel="Time (seconds)",
)

# Now we want to understand if order matters!
# Let's just look at increasing by 1, for c2-standard-8
df1 = df[df.machine_type == "c2-standard-8"]
df1 = df1[df1.increment == 1]

# Create an order column
orders = [int(x.split("_")[-1]) for x in list(df1.key.values)]
df1["orders"] = orders
df1up = df1[df1.direction == "up"]
df1down = df1[df1.direction == "down"]

# Up
ax = sns.lineplot(data=df1up, x="orders", y="seconds", hue="iteration")
plt.title("Incremental time to add a node (with outliers)")
ax.set_xlabel("Node index", fontsize=16)
ax.set_ylabel("Time (seconds)", fontsize=16)
ax.set_xticklabels(ax.get_xmajorticklabels(), fontsize=14)
ax.set_yticklabels(ax.get_yticks(), fontsize=14)
plt.savefig(os.path.join(outdir, f"add_node_incremental.{ext}"))
plt.clf()

# Remove outlier
df1up = df1up[df1up.seconds <= 100]
ax = sns.lineplot(data=df1up, x="orders", y="seconds", hue="iteration")
plt.title("Incremental time to add a node (without outliers)")
ax.set_xlabel("Node index", fontsize=16)
ax.set_ylabel("Time (seconds)", fontsize=16)
ax.set_xticklabels(ax.get_xmajorticklabels(), fontsize=14)
ax.set_yticklabels(ax.get_yticks(), fontsize=14)
plt.savefig(os.path.join(outdir, f"add_node_incremental_no_outliers.{ext}"))
plt.clf()

# Down
ax = sns.lineplot(data=df1down, x="orders", y="seconds", hue="iteration")
plt.title("Incremental time to remove a node (with outliers)")
ax.set_xlabel("Node index", fontsize=16)
ax.set_ylabel("Time (seconds)", fontsize=16)
ax.set_xticklabels(ax.get_xmajorticklabels(), fontsize=14)
ax.set_yticklabels(ax.get_yticks(), fontsize=14)
plt.savefig(os.path.join(outdir, f"remove_node_incremental.{ext}"))
plt.clf()

# Remove outlier
df1down = df1down[df1down.seconds <= 100]
ax = sns.lineplot(data=df1down, x="orders", y="seconds", hue="iteration")
plt.title("Incremental time to remove a node (without outliers)")
ax.set_xlabel("Node index", fontsize=16)
ax.set_ylabel("Time (seconds)", fontsize=16)
ax.set_xticklabels(ax.get_xmajorticklabels(), fontsize=14)
ax.set_yticklabels(ax.get_yticks(), fontsize=14)
plt.savefig(os.path.join(outdir, f"remove_node_incremental_no_outliers.{ext}"))
plt.clf()


def make_plot(
df,
Expand Down

0 comments on commit 93a4728

Please sign in to comment.