0e346b939d
Mirror the sccl pattern for GEMM figures: a tests/gemm/ package renders the GEMM bar charts as PNGs from the committed docs/diagrams/gemm_sweep.json, so the figures are fast test artifacts (run by default) while the heavy sim sweep stays a manual script (scripts/gemm_sweep.py, kept) wrapped by a slow regenerator test. tests/gemm/: - _gemm_plot_helpers.py: matplotlib renderers (series logic mirrors the GEMM _render_* functions in scripts/build_overview_slides.py). - test_plot_gemm_stage_breakdown.py: gemm_stage_breakdown.png (load_ref). - test_plot_gemm_mac_utilization.py: gemm_mac_utilization_measured.png + gemm_mac_utilization_theoretical_vs_measured.png (load_ref). - test_gemm_sweep.py: @pytest.mark.slow regenerator (runs scripts/gemm_sweep.py). Chart set trimmed to three (stage breakdown, MAC util, theoretical-vs-measured); "formula" relabeled to "theoretical" throughout the comparison chart. Known follow-ups (not blocking): - gemm_mac_utilization_measured.png currently plots the theoretical ideal- pipeline model, not simulator-measured data; the name is a misnomer pending a decision to repoint its content or retitle. - The theoretical-model constants (HBM 256 GB/s, T_stage 16 ns, 3 stages) are inherited verbatim from build_overview_slides.py and not yet verified against ADR-0033 / ADR-0014 / topology. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
"""Emit the GEMM MAC-utilization bar charts.
|
|
|
|
A measured chart (load_ref) plus the theoretical-vs-measured overlay (load_ref).
|
|
Reads docs/diagrams/gemm_sweep.json and writes gemm_mac_utilization*.png into
|
|
docs/diagrams/gemm_plots/.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
from tests.gemm._gemm_plot_helpers import (
|
|
GEMM_SWEEP_JSON,
|
|
emit_mac_utilization_measured,
|
|
emit_mac_utilization_theoretical_vs_measured,
|
|
)
|
|
|
|
|
|
@pytest.mark.skipif(
|
|
not GEMM_SWEEP_JSON.exists(),
|
|
reason="gemm_sweep.json absent; run scripts/gemm_sweep.py first",
|
|
)
|
|
def test_plot_gemm_mac_utilization_measured():
|
|
out = emit_mac_utilization_measured()
|
|
assert out is not None and Path(out).exists()
|
|
|
|
|
|
@pytest.mark.skipif(
|
|
not GEMM_SWEEP_JSON.exists(),
|
|
reason="gemm_sweep.json absent; run scripts/gemm_sweep.py first",
|
|
)
|
|
def test_plot_gemm_mac_utilization_theoretical_vs_measured():
|
|
out = emit_mac_utilization_theoretical_vs_measured()
|
|
assert out is not None and Path(out).exists()
|