Skip to content

Commit 5ea6e51

Browse files
MilkCloudscdjkim
authored andcommitted
code commit
0 parents  commit 5ea6e51

234 files changed

Lines changed: 46458 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/assets/demand_supply.png

81.8 KB
Loading

.github/assets/demand_supply.svg

Lines changed: 1701 additions & 0 deletions
Loading
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
"""Generate the demand/supply throughput figure for README.
2+
3+
Adapted from the paper figure (scripts/plot_multiline.py) for web display.
4+
5+
Usage:
6+
uv run --with matplotlib python .github/assets/gen_demand_supply_chart.py
7+
8+
Output:
9+
.github/assets/demand_supply.png
10+
.github/assets/demand_supply.svg
11+
"""
12+
13+
import matplotlib
14+
15+
matplotlib.use("Agg")
16+
import matplotlib.pyplot as plt
17+
from matplotlib.lines import Line2D
18+
19+
plt.rcParams.update(
20+
{
21+
"figure.dpi": 200,
22+
"font.family": "sans-serif",
23+
"font.sans-serif": ["DejaVu Sans"],
24+
"axes.linewidth": 0.6,
25+
"axes.grid": True,
26+
"grid.alpha": 0.15,
27+
"grid.linewidth": 0.4,
28+
}
29+
)
30+
31+
# --- Data (LIBERO + CogACT, H100 — from docs/tuning-guide.md) ---
32+
N = [1, 8, 16, 24, 32, 50, 64, 80, 100]
33+
lam = [11.2, 82.9, 152.1, 214.2, 267.1, 364.6, 410.2, 446.8, 389.4]
34+
35+
# Supply ceilings: batch size B -> max throughput (obs/s)
36+
supply_lines = [(1, 165.2), (2, 255.4), (4, 347.3), (8, 423.8), (16, 468.2)]
37+
38+
# Operating point
39+
N_star, lam_star = 50, 364.6
40+
41+
# --- Colors (AI2 palette, matching paper) ---
42+
C_DEMAND = "#0a3235"
43+
C_SUPPLY = "#8b4049" # muted burgundy
44+
C_SUPPLY_TXT = "#6b2d35"
45+
C_OP = "#f0529c"
46+
C_OP_TXT = "#c0407d"
47+
48+
fig, ax = plt.subplots(figsize=(7, 3.5))
49+
50+
# Supply ceiling lines
51+
for b, m in supply_lines:
52+
ax.axhline(y=m, color=C_SUPPLY, linestyle="--", linewidth=1.0, alpha=0.85, zorder=1)
53+
ax.text(2, m + 6, f"$B$={b}", fontsize=8, color=C_SUPPLY_TXT, fontstyle="italic")
54+
55+
# Demand curve: normal (up to operating point)
56+
ax.plot(
57+
N[:7],
58+
lam[:7],
59+
"o-",
60+
color=C_DEMAND,
61+
markersize=5,
62+
linewidth=1.6,
63+
markerfacecolor=C_DEMAND,
64+
markeredgecolor="white",
65+
markeredgewidth=0.5,
66+
zorder=3,
67+
)
68+
# Demand curve: oversaturated region
69+
ax.plot(
70+
N[6:], lam[6:], "o--", color=C_DEMAND, markersize=4, linewidth=0.9, markerfacecolor=C_DEMAND, alpha=0.35, zorder=3
71+
)
72+
73+
# Operating point
74+
ax.plot(N_star, lam_star, "D", color=C_OP, markersize=9, zorder=5, markeredgecolor="white", markeredgewidth=0.7)
75+
ax.annotate(
76+
r"$N^*\!=\!50$",
77+
xy=(N_star, lam_star),
78+
xytext=(70, 260),
79+
fontsize=11,
80+
color=C_OP_TXT,
81+
ha="center",
82+
weight="bold",
83+
arrowprops=dict(arrowstyle="->", color=C_OP_TXT, lw=1.0),
84+
)
85+
86+
ax.set_xlabel("Episode workers $N$", fontsize=11)
87+
ax.set_ylabel("Throughput (obs/s)", fontsize=11)
88+
ax.set_xlim(-2, 105)
89+
ax.set_ylim(0, 540)
90+
ax.tick_params(labelsize=10)
91+
92+
legend_elements = [
93+
Line2D(
94+
[0],
95+
[0],
96+
color=C_DEMAND,
97+
marker="o",
98+
markersize=5,
99+
linewidth=1.4,
100+
markerfacecolor=C_DEMAND,
101+
label=r"Demand $\lambda(N)$",
102+
),
103+
Line2D([0], [0], color=C_SUPPLY, linestyle="--", linewidth=1.0, alpha=0.85, label=r"Supply $\mu(B)$ ceilings"),
104+
Line2D(
105+
[0], [0], color=C_OP, marker="D", markersize=6, linewidth=0, markeredgecolor="white", label="Operating point"
106+
),
107+
]
108+
ax.legend(handles=legend_elements, fontsize=9, loc="lower right", framealpha=0.95, edgecolor="#ddd")
109+
110+
ax.spines["top"].set_visible(False)
111+
ax.spines["right"].set_visible(False)
112+
ax.set_axisbelow(True)
113+
114+
plt.tight_layout()
115+
fig.savefig(".github/assets/demand_supply.png", dpi=200, bbox_inches="tight", facecolor="white")
116+
fig.savefig(".github/assets/demand_supply.svg", bbox_inches="tight", facecolor="white")
117+
print("Saved .github/assets/demand_supply.{png,svg}")
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
"""Generate the speedup comparison bar chart for README.
2+
3+
Adapted from the paper figure (scripts/gen_speedup_fig.py) for web display.
4+
5+
Usage:
6+
uv run --with matplotlib python .github/assets/gen_speedup_chart.py
7+
8+
Output:
9+
.github/assets/speedup_comparison.png
10+
.github/assets/speedup_comparison.svg
11+
"""
12+
13+
import matplotlib
14+
15+
matplotlib.use("Agg")
16+
import matplotlib.pyplot as plt
17+
import matplotlib.ticker as mticker
18+
import numpy as np
19+
20+
plt.rcParams.update(
21+
{
22+
"figure.dpi": 200,
23+
"font.family": "sans-serif",
24+
"font.sans-serif": ["DejaVu Sans"],
25+
"axes.linewidth": 0.6,
26+
"axes.grid": True,
27+
"grid.alpha": 0.12,
28+
"grid.linewidth": 0.4,
29+
}
30+
)
31+
32+
# --- Data (from paper Table / Section III-C) ---
33+
benchmarks = ["LIBERO", "CALVIN", "SimplerEnv"]
34+
sequential = [14, 8.6, 1.73] # hours
35+
parallel = [0.3, 0.55, 0.14] # hours
36+
speedup_labels = ["47\u00d7", "16\u00d7", "12\u00d7"]
37+
par_labels = ["18 min", "33 min", "8.5 min"]
38+
seq_labels = ["14 h", "8.6 h", "1.7 h"]
39+
40+
x = np.arange(len(benchmarks))
41+
width = 0.34
42+
43+
# --- Colors ---
44+
C_SEQ = "#1b5e5e"
45+
C_PAR = "#e24a8d"
46+
C_BADGE = "#da9679"
47+
48+
fig, ax = plt.subplots(figsize=(7, 3))
49+
50+
bars_seq = ax.bar(
51+
x - width / 2, sequential, width, color=C_SEQ, edgecolor="white", linewidth=0.5, label="Sequential", zorder=3
52+
)
53+
bars_par = ax.bar(
54+
x + width / 2, parallel, width, color=C_PAR, edgecolor="white", linewidth=0.5, label="Batch Parallel", zorder=3
55+
)
56+
57+
# Sequential labels
58+
for bar, lbl in zip(bars_seq, seq_labels):
59+
y_pos = bar.get_height()
60+
if y_pos > 4:
61+
ax.text(
62+
bar.get_x() + bar.get_width() / 2,
63+
y_pos - 0.4,
64+
lbl,
65+
ha="center",
66+
va="top",
67+
fontsize=11,
68+
color="white",
69+
fontweight="bold",
70+
)
71+
else:
72+
ax.text(
73+
bar.get_x() + bar.get_width() / 2,
74+
y_pos + 0.15,
75+
lbl,
76+
ha="center",
77+
va="bottom",
78+
fontsize=9.5,
79+
color="#134a4a",
80+
fontweight="bold",
81+
)
82+
83+
# Parallel labels
84+
for bar, lbl in zip(bars_par, par_labels):
85+
ax.text(
86+
bar.get_x() + bar.get_width() / 2,
87+
bar.get_height() + 0.25,
88+
lbl,
89+
ha="center",
90+
va="bottom",
91+
fontsize=9,
92+
color="#b83a70",
93+
fontweight="bold",
94+
)
95+
96+
# Speedup badges
97+
badge_y = [sequential[0] + 0.6, sequential[1] + 0.6, 4.5]
98+
for i, s in enumerate(speedup_labels):
99+
ax.text(
100+
x[i],
101+
badge_y[i],
102+
s,
103+
ha="center",
104+
va="bottom",
105+
fontsize=13,
106+
fontweight="bold",
107+
color=C_BADGE,
108+
bbox=dict(boxstyle="round,pad=0.25", facecolor="#f5ddd0", edgecolor="#da9679", linewidth=0.8),
109+
)
110+
# Arrow from SimplerEnv badge to bar
111+
ax.annotate(
112+
"", xy=(x[2], sequential[2] + 0.3), xytext=(x[2], 4.4), arrowprops=dict(arrowstyle="->", color=C_BADGE, lw=0.9)
113+
)
114+
115+
ax.set_ylabel("Wall-clock time (hours)", fontsize=11)
116+
ax.set_xticks(x)
117+
ax.set_xticklabels(benchmarks, fontsize=12)
118+
ax.set_ylim(0, 18)
119+
ax.yaxis.set_major_locator(mticker.MultipleLocator(4))
120+
ax.yaxis.grid(True, linestyle="-", alpha=0.12, zorder=0)
121+
ax.set_axisbelow(True)
122+
ax.spines["top"].set_visible(False)
123+
ax.spines["right"].set_visible(False)
124+
ax.tick_params(axis="both", labelsize=10)
125+
ax.legend(loc="upper right", fontsize=10, frameon=True, fancybox=False, edgecolor="#bbbbbb", framealpha=0.92)
126+
127+
plt.tight_layout()
128+
fig.savefig(".github/assets/speedup_comparison.png", dpi=200, bbox_inches="tight", facecolor="white")
129+
fig.savefig(".github/assets/speedup_comparison.svg", bbox_inches="tight", facecolor="white")
130+
print("Saved .github/assets/speedup_comparison.{png,svg}")
48.3 KB
Loading

0 commit comments

Comments
 (0)