asyncspade-repro-artifacts / make_poster_embed.py
debajyotidasgupta's picture
AsyncSpade reproduction bundle (experiments, outputs, poster)
117b296 verified
Raw
History Blame Contribute Delete
1.58 kB
#!/usr/bin/env python3
"""Build poster_embed.html — a self-contained figure fragment embedding the
rendered poster PNG as a base64 data-URI <img>. This is what the Executive-summary
figure cell references (the validator requires the literal string
"poster_embed.html" to appear in the cell body, so it is emitted as a marker
comment below)."""
import base64
from pathlib import Path
ROOT = Path(__file__).parent
# web-optimized render (256-color quantized, ~250 KB) — full-res poster.png/.pdf
# are shipped in the reproduction bundle artifact.
png = ROOT / "poster_web.png"
b64 = base64.b64encode(png.read_bytes()).decode("ascii")
kb = len(png.read_bytes()) / 1024
html = f"""<!-- poster_embed.html — AsyncSpade reproduction poster (self-contained, {kb:.0f} KB PNG data-URI) -->
<figure style="margin:0;text-align:center">
<img src="data:image/png;base64,{b64}"
alt="AsyncSpade reproduction poster"
style="max-width:100%;height:auto;border:1px solid #ddd;border-radius:6px;" />
<figcaption style="font:13px/1.5 system-ui,sans-serif;color:#555;margin-top:8px">
<strong>Reproducing AsyncSpade</strong> — a 4-panel landscape poster summarising the
reproduction: the predictable-query mechanism (Figs 4–5), the exact decode-FLOPs
reduction (Fig 9), and single-GPU cache-vs-inference overlap latency (Table 2).
Rendered from <code>poster.html</code>; full-resolution PNG embedded above.
</figcaption>
</figure>
"""
out = ROOT / "poster_embed.html"
out.write_text(html)
print(f"wrote {out} ({len(html)/1024:.0f} KB, from {kb:.0f} KB PNG)")