-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(topolotree): perf improvements and better deploy logic
- Loading branch information
Showing
17 changed files
with
429 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*.csv | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
To collect memory/latency versus cluster size: | ||
```bash | ||
$ hydro deploy topolotree_latency.hydro.py -- gcp pn,pn_delta,topolo 2,3,4,5,6,7,8 1 1 | ||
``` | ||
|
||
To collect latency vs throughput: | ||
```bash | ||
$ hydro deploy topolotree_latency.hydro.py -- gcp pn,pn_delta,topolo 6 1/1,2/1,4/1,8/1,16/1,32/1,64/1,128/1,256/1,512/1,1024/1,1024/2,1024/4,1024/8 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# See https://stackoverflow.com/a/19521297/3187068 | ||
import matplotlib | ||
matplotlib.use('pdf') | ||
font = {'size': 16} | ||
matplotlib.rc('font', **font) | ||
|
||
from typing import Any, List | ||
import argparse | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
import os | ||
import pandas as pd | ||
import re | ||
|
||
markers = ["o", "^", "s", "D", "p", "P", "X", "d"] | ||
|
||
def plot_lt(throughput_rows: pd.DataFrame, latency_rows: pd.DataFrame, ax: plt.Axes, marker: str, label: str) -> None: | ||
throughput = throughput_rows["mean"]# / 1000 | ||
throughput_std = throughput_rows["std"]# / 1000 | ||
latency = latency_rows["percentile_50"] / 1000 | ||
line = ax.plot(throughput, latency, marker, label=label, linewidth=2)[0] | ||
ax.fill_betweenx(latency, | ||
throughput - throughput_std, | ||
throughput + throughput_std, | ||
color = line.get_color(), | ||
alpha=0.25) | ||
|
||
|
||
def main(args) -> None: | ||
fig, ax = plt.subplots(1, 1, figsize=(8, 4)) | ||
ax.set_ylim(top=25) | ||
ax.set_xscale('log') | ||
ax.get_xaxis().set_major_formatter(matplotlib.ticker.ScalarFormatter()) | ||
|
||
dfs = pd.read_csv(args.results) | ||
|
||
# Abbreviate fields. | ||
for i, df in enumerate([dfs.groupby(["protocol"])]): | ||
for protocol, group in df: | ||
throughput_rows = group[group["kind"] == "total_throughput"] | ||
latency_rows = group[group["kind"] == "latency"] | ||
|
||
if protocol == "pn": | ||
protocol = "PN-Counter" | ||
elif protocol == "pn_delta": | ||
protocol = "\"Delta-PN\"" | ||
elif protocol == "topolo": | ||
protocol = "OnceTree" | ||
|
||
plot_lt(throughput_rows, latency_rows, ax, markers[i] + "-", protocol) | ||
|
||
ax.set_title('') | ||
ax.set_xlabel('Throughput (ops / second)') | ||
ax.set_ylabel('Median Latency (ms)') | ||
ax.legend(loc='upper right') | ||
ax.grid() | ||
fig.savefig(args.output, bbox_inches='tight') | ||
print(f'Wrote plot to {args.output}.') | ||
|
||
fig_leg = plt.figure(figsize=(len(args.title)*3, 0.5)) | ||
ax_leg = fig_leg.add_subplot(111) | ||
# add the legend from the previous axes | ||
ax_leg.legend(*ax.get_legend_handles_labels(), loc='center', ncol=len(args.title)) | ||
# hide the axes frame and the x/y labels | ||
ax_leg.axis('off') | ||
# fig_leg.savefig('legend.pdf') | ||
|
||
|
||
def get_parser() -> argparse.ArgumentParser: | ||
parser = argparse.ArgumentParser() | ||
|
||
parser.add_argument('--results', | ||
type=argparse.FileType('r'), | ||
help='results.csv file') | ||
parser.add_argument('--title', | ||
type=str, | ||
help='Title for each experiment') | ||
parser.add_argument('--output', | ||
type=str, | ||
default='compartmentalized_lt.pdf', | ||
help='Output filename') | ||
|
||
return parser | ||
|
||
|
||
if __name__ == '__main__': | ||
parser = get_parser() | ||
main(parser.parse_args()) |
Oops, something went wrong.