szl-compute-energy-receipt
Turns a compute run's energy evidence into a typed receipt (MEASURED from counter samples, REPORTED from vendor totals or TDP estimates, UNAVAILABLE when nothing usable exists) with kWh, optional CO2e from a declared grid factor, and a ready-to-paste methods sentence. Use when a paper, grant report or model card needs an energy or carbon statement for training, simulation or inference runs, or when a reviewer asks how much compute was used. Not a hardware monitor and not a carbon-accounting standard.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- szl-compute-energy-receipt
- license
- Apache-2.0
- description
- Turns a compute run's energy evidence into a typed receipt (MEASURED from counter samples, REPORTED from vendor totals or TDP estimates, UNAVAILABLE when nothing usable exists) with kWh, optional CO2e from a declared grid factor, and a ready-to-paste methods sentence. Use when a paper, grant report or model card needs an energy or carbon statement for training, simulation or inference runs, or when a reviewer asks how much compute was used. Not a hardware monitor and not a carbon-accounting standard.
02 资源文件 5
- 资产文件assets/example.json504 B
- 资产文件assets/unavailable-example.json125 B
- 脚本kernel.py5.8 KB
- 参考文档references/contract.md691 B
- 脚本scripts/run.py973 B
03 SKILL.md 正文
Compute energy receipt
Reviewers and funders increasingly ask what a run cost in energy. Most answers are estimates dressed as measurements. This skill keeps the two apart: it integrates power samples if you have them, labels anything else REPORTED or UNAVAILABLE, and writes the methods sentence that says so. Stdlib only, offline; it never reads hardware counters itself.
Use when
- "Add an energy statement to the methods section" for a fine-tune, MD simulation or inference sweep.
- A model card needs a compute figure and you have an NVML or RAPL log, or only a cloud bill.
- A reviewer asks for CO2e and you must disclose that the grid factor is a published average.
Quick start
python scripts/run.py assets/example.json
Seven NVML samples over 60 s give "status": "MEASURED" and this sentence:
The run on 1x RTX 4060 Ti 16 GB consumed 0.002 kWh (8072 J), measured via nvml power sampling (7 samples over 60 s). Applying the declared grid factor of 386 gCO2e/kWh (declared regional annual average (operator supplied)) gives 1 gCO2e (REPORTED, not measured).
assets/unavailable-example.json has no energy evidence and yields the honest alternative:
"Energy consumption of this run on laptop CPU was not measured and is reported as UNAVAILABLE."
Input
{"run": {"id": "...", "purpose": "...", "hardware": "...", "duration_s": 60},
"measurement": {"source": "nvml|rapl|metered_plug|pdu|ipmi|vendor|estimate|none",
"samples": [{"t": 0, "w": 62.0}, ...] OR "joules": 8072 OR "tdp_w": 165,
"max_gap_s": 10},
"grid": {"g_co2e_per_kwh": 386, "source": "where the factor comes from"}}
Samples are integrated trapezoidally. MEASURED requires a counter source and no gap larger than
max_gap_s; otherwise the class drops to REPORTED and the reason is recorded (SAMPLE_GAP_EXCEEDS_LIMIT,
TDP_TIMES_DURATION_ESTIMATE, VENDOR_OR_ESTIMATE). A grid factor without a source is ignored.
What it does not do
It does not sample hardware, does not estimate embodied emissions or data-centre overhead (PUE), does not compare efficiency between runs, and never promotes an estimate to MEASURED. The receipt digest covers the record as written, not the truth of the declared samples.
04 同仓库更多 Skills
szl-unit-invariants
Checks declared SI dimensions, allowlisted unit conversions, expected ranges and fixed pointwise invariants (equal, sum, difference, product, ratio) over selected measurement or simulation columns, flagging incompatible quantities, scale errors of 1000x and broken conservation checks. Use when merging instrument exports with different units, validating simulation output against conservation laws, or when a reviewer asks how unit errors were ruled out. Not an uncertainty-propagation or symbolic tool.
szl-uncertainty-lineage
Propagate declared measurement uncertainty through a small arithmetic dependency graph using a first-order delta approximation. Use when a researcher needs to see how corrected inputs or shared-source correlation change a reported standard uncertainty; require unit checks separately.
szl-typesafe-ai
TypeSafe/Jev: Choice/Noul/Score in code, not TypeScript types. System One models turn natural language and application state into probabilities that software can compose. Use when building routing, ranking, extraction, verification, or replacing an LLM prompt-and-parse step with structured decisions; also when brainstorming what TypeSafe could make possible. Do not use for TypeScript/Java/Rust static types, Zod/Pydantic/mypy/JSON Schema/protobuf codegen, or asking whether a pipeline is type-safe. At SZL, Jev is an optional second reader only.
demo
暂无简介
demo
暂无简介
szl-skill-update-review
Compare pinned local skill packages using inventories and a retained lock; report changed skills, files, declarations and reruns without approving safety or validity.