fom_extractor

A measurement tool for ORBIT-2 training runs. It calculates figures of merit (FOMs), such as samples processed per second and batch time, from logs, traces, and monitoring data.

In plain words
What is it for?
Writing performance results to JSON and optionally producing a CSV that links measured time to individual computing kernels.
Why use it?
It turns several performance outputs into a consistent summary and can compare tracing data with Omnistat telemetry when both are available.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/amdresearch/ai4science-studio/fom_extractor
Clone the repo
git clone --depth 1 https://github.com/AMDResearch/ai4science-studio
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,491 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01491
Opus 5 $0.00000 $0.00745
Sonnet 5 $0.00000 $0.00298
Haiku 4.5 $0.00000 $0.00149

Measured 3d ago against content hash e6f33a4935c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

fom_extractor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

earth_science/models/ORBIT-2/recipes/perf-optimizer-loop/agents/fom_extractor.md · 99 lines

How it starts

The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on GitHub.

fom_extractor subagent — ORBIT-2

Computes per-iteration FOMs for the ORBIT-2 loop and optionally TraceLens↔Omnistat correlation (reuse HydraGNN §4 algorithm when traces exist).

Inputs

  • <perf_run>/manifest.json — must include job_id, runtime_seconds, global_batch_size, parallelism, data_type.
  • <perf_run>/orbit2-train-<jobid>.out
  • <perf_run>/omnistat-db/ + live VM URL (or start VM with -fs.disableMmap)
  • <perf_run>/traces/*.pt.trace.json (rank-0 kineto)

Outputs

  • <perf_run>/foms.json — schema below
  • <perf_run>/kernel_correlation.csv — optional; same column idea as HydraGNN fom_extractor.md

foms.json schema (ORBIT-2)

{
  "job_id": "12345",
  "primary_fom": "throughput_samples_per_s",
  "throughput_samples_per_s": 1.23e4,
  "steady_batch_time_s": 0.41,
  "global_batch_size": 2048,
  "mfma_bf16_tflops_per_card_avg": null,
  "hbm_read_GBps_per_card_avg": null,
  "xgmi_GBps_avg": null,
  "loss_sanity_pass": true,
  "final_loss": 0.05
}

Step 1 — Log FOMs (required)

Run the repo extractor (writes foms.json base fields):

python3 "$REPO_ROOT/earth_science/models/ORBIT-2/examples/run_fom_extractor.py" --job-dir "$PERF_RUN"

If manifest.json lacks global_batch_size, pass --global-batch-size explicitly.

Effective-batch integrity (read before trusting a throughput delta): foms.json includes hbm_reserved_GB, hbm_reserved_pct_288, max_batches_per_epoch, throughput_method, partial_step_fraction, and steady_realized_batch_dims. Throughput now prefers the real per-step batch dim (throughput_method=real_per_step_batch, read from the EDM y.shape line) instead of the nominal global_batch_size, so partial trailing batches no longer inflate it. Still reject any cross-run comparison where partial_step_fraction, steady_realized_batch_dims, hbm_reserved_pct_288, or max_batches_per_epoch deviates materially from the baseline — even a correct number can hide a different work mix.

Read the full file on GitHub · 99 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 99 lines · 0 tokens per session scan A e6f33a4935c2

Subscribe to this mod's changes

fom_extractor is an agent published in the GitHub repository AMDResearch/ai4science-studio (4 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,491 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.