Download docs/evidence/plot_glm53_spark.py from staccs/ds4-winhip: direct link, hf CLI and curl.
- Browser
- Download file 2.49 kB
-
https://huggingface.co/staccs/ds4-winhip/resolve/main/docs/evidence/plot_glm53_spark.py
- Command line
-
hf download hf://staccs/ds4-winhip/docs/evidence/plot_glm53_spark.py
-
curl -L -o plot_glm53_spark.py https://huggingface.co/staccs/ds4-winhip/resolve/main/docs/evidence/plot_glm53_spark.py
2.49 kB
| #!/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() | |