Opens a larger view. Escape closes it.

hardware-counters

promised_check.py

"""
Which of the feasibility study's promised experiments are still deliverable?

The study promised: IMB communication microbenchmarks, I/O kernels, GPU
microbenchmarks, blind held-out-platform validation, and power-performance
co-modelling (milestone M7, RAPL/NVML). Check what the EXISTING data already
supports before proposing any new runs.
"""
import os
import numpy as np, pandas as pd

D = os.environ.get("DISS_ROOT", "/work/project/project/user")
df = pd.read_csv(f"{D}/data/runs_expanded.csv")
df = df[df.runtime_s > 0]

print("=== M7 power-performance co-modelling: is the energy data usable? ===")
for c in ("PACKAGE_ENERGY", "PP0_ENERGY"):
    if c not in df.columns:
        print(f"  {c}: ABSENT"); continue
    v = pd.to_numeric(df[c], errors="coerce")
    print(f"  {c}: {v.notna().sum()}/{len(df)} rows non-null "
          f"({100*v.notna().mean():.0f}%), median {v.median():.0f} J")

keys = ["app", "size", "ncore", "nthread"]
agg = {"PACKAGE_ENERGY": "median", "PP0_ENERGY": "median",
       "runtime_s": "median", "PAPI_TOT_CYC": "median"}
m = df.groupby(keys, as_index=False).agg(agg)
m = m[m.PACKAGE_ENERGY.notna() & (m.PACKAGE_ENERGY > 0)]
print(f"\n  merged configurations with energy: {len(m)}")
print(f"  energy-to-solution range: {m.PACKAGE_ENERGY.min():.0f} - "
      f"{m.PACKAGE_ENERGY.max():.0f} J")

e, t = m.PACKAGE_ENERGY.values, m.runtime_s.values
r = np.corrcoef(np.log10(e), np.log10(t))[0, 1]
print(f"  log-log r(energy, runtime) = {r:.3f}")
print("  -> if r is well below 1, energy is a genuinely SEPARATE prediction")
print("     target, not a restatement of runtime, so M7 is a real experiment.")

print("\n  average power (J/s) spread, per application:")
m2 = m.assign(power=e / t)
print(m2.groupby("app").power.median().round(1).to_string())
print("  -> variation here is what a power model would have to predict.")

print("\n=== what a second target would add ===")
print(f"  configurations available for energy modelling: {len(m)}")
print("  no new runs required: PACKAGE_ENERGY and PP0_ENERGY were collected")
print("  on every ARCHER2 counter-set run via cray_rapl.")