File size: 2,485 Bytes
bb74494
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env python3
"""Render the recorded paired medians; no inference or new measurements."""

import json
from pathlib import Path

import matplotlib

matplotlib.use("Agg")
import matplotlib.pyplot as plt


ROOT = Path(__file__).resolve().parent
DATA = ROOT / "glm53-spark-2026-10-07.json"
OUTPUT = ROOT / "glm53-spark-paired"
PANELS = [
    ("attention", "8192", "prefill_tps", "Attention 路 8K prefill", "+3.08%"),
    ("pool", "8192", "prefill_tps", "Pooled scores 路 8K prefill", "+8.91%"),
    ("pool", "8192", "gen_tps", "Pooled scores 路 8K decode", "+1.77%"),
    ("shared_q8", "2048", "gen_tps", "Shared Q8 路 2K decode", "+0.47%"),
]


def main():
    data = json.loads(DATA.read_text())
    plt.rcParams.update({"font.size": 10, "axes.spines.top": False,
                         "axes.spines.right": False})
    fig, axes = plt.subplots(1, len(PANELS), figsize=(12, 3.6))
    for ax, (name, ctx, metric, title, gain) in zip(axes, PANELS):
        result = data["rounds"][name]["frontiers"][ctx]
        median = result["median_tps"][metric]
        values = [median["off"], median["on"]]
        ax.bar([0, 1], values, color=["#a3afbd", "#287fbb"], width=0.58)
        for i, value in enumerate(values):
            ax.text(i, value + max(values) * 0.025, f"{value:.2f}", ha="center")
        for arm, row in result["arms"].items():
            x = 0 if arm.startswith("off") else 1
            ax.scatter(x, float(row["metrics"][metric]), s=12, color="#172637",
                       zorder=3)
        ax.set_xticks([0, 1], ["Off", "On"])
        ax.set_ylim(0, max(values) * 1.22)
        ax.set_title(title + "\n" + gain, fontsize=11)
        ax.set_ylabel("tokens/s")
        ax.grid(axis="y", alpha=0.18)
        ax.set_axisbelow(True)
    fig.suptitle("GLM-5.3 Flash Uncensored 路 DGX Spark 路 paired rounds", fontsize=14)
    fig.text(0.5, 0.025,
             "One raw VMM owner / one fresh worker 路 SSD off 路 MTP off 路 64 greedy output tokens\n"
             "Bars: matched medians; dots: individual arms. Each panel has its own retained baseline.",
             ha="center", fontsize=9)
    fig.tight_layout(rect=(0, 0.13, 1, 0.92))
    fig.savefig(OUTPUT.with_suffix(".png"), dpi=180)
    svg = OUTPUT.with_suffix(".svg")
    fig.savefig(svg)
    # Keep generated SVG clean for git whitespace checks.
    svg.write_text("\n".join(line.rstrip() for line in svg.read_text().splitlines()) + "\n")
    plt.close(fig)


if __name__ == "__main__":
    main()