agentleFS
AI-HypercomputerAI-Hypercomputer/maxtext/.agents/skills/maxtext-goodput/SKILL.md

maxtext-goodput

Skill2.5k starsChanged 4 days agoApache-2.0View on GitHub

Run and monitor MaxText training jobs with ML Goodput Measurement (`ml-goodput-measurement`). Use when enabling Goodput and Badput recording or monitoring in MaxText, configuring cumulative or rolling-window Goodput flags, or inspecting Goodput outputs in training logs, Google Cloud Logs Explorer, Metrics Explorer, and Google Cloud Monitoring Dashboards.

Trending

Less talk lately.about the whole repository

Jan 2026: 0 mentionsFeb 2026: 2 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 1 mentionJun 2026: 1 mentionJul 2026: 4 mentionsAug 2026: 7 mentionsSep 2026: 12 mentionsOct 2026: 19 mentionsNov 2026: 2 mentionsDec 2026: 1 mention
Jan 2026Jul 2026Dec 2026
Mentions a month of the AI-Hypercomputer/maxtext repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about AI-Hypercomputer/maxtext

The biggest 5 of 50 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 50

Talked about on GitHub (50 times).

On GitHub · 50

45 more on GitHub

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Unique run_name per run: Always use a fresh run_name (or goodput_job_name) for each new experiment so goodput_<run_name> does not mix …

    line 73
  2. Very specific:

    Follow the MaxText Pre-Training on TPUs tutorial (llama3-8b) and append the Goodput flags:

    line 78
  3. Distinctive:

    Verify that the background uploaders started, published metrics, and flushed on exit:

    line 113

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

MaxText Goodput Measurement

Reference docs:


1. Overview & Metrics

  • Goodput is the percentage of a training job's wall-clock time spent on productive training steps.
  • Badput is the remaining wall-clock time spent on non-training overhead (initialization, compilation, synchronous data loading, blocking checkpoint saves/restores, disruptions, and custom events).

In MaxText, Goodput measurement runs on the lead host (jax.process_index() == 0) in two parts:

  1. Record (enable_goodput_recording=true): GoodputRecorder writes start/end timestamps for job, step, and overhead events to Google Cloud Logging under goodput_<run_name>.
  2. Monitor (monitor_goodput=true): GoodputMonitor runs background uploaders that read Cloud Logging via GoodputCalculator and export cumulative and rolling-window metrics to TensorBoard and Google Cloud Monitoring (GCM).

Why Use Goodput Library Instead of a Vanilla Timer?

  • Survives crashes & preemptions: Persists timestamps to Cloud Logging to measure cluster recovery downtime (INFRASTRUCTURE_RECOVERY_FROM_DISRUPTION) and retroactively reclassify steps lost after a rollback (WASTED_PROGRESS_FROM_DISRUPTION).
  • Separates blocking vs. async I/O: Counts only synchronous stalls (DATA_LOADING_SYNC, UNPRODUCTIVE_CHECKPOINT_SAVE_TIME via Orbax Cloud Logger) without penalizing overlapped prefetching or background checkpointing.
  • Isolates compilation & step anomalies: Automatically separates first-step JAX/XLA compilation (PROGRAM_STARTUP) from steady-state steps and tracks workload/step_time_deviation.
  • Full wall-clock attribution & rolling windows: Reconciles 100% of job lifetime into standardized BadputType buckets across both cumulative and sliding windows (1h, 1d, 3d, 5d).
  • Zero training-loop overhead: Logs asynchronously from host 0 only and computes/exports metrics out-of-process to TensorBoard and Google Cloud Monitoring.

Google Cloud Monitoring (GCM) Metrics

Full details: Access Metrics on Google Cloud Monitoring.

MetricGCM Metric (compute.googleapis.com/...)PromQL Name (compute_googleapis_com:...)Description
Cumulative Goodputworkload/goodput_timeworkload_goodput_timeCumulative productive training time (s), labeled by goodput_source.
Cumulative Badputworkload/badput_timeworkload_badput_timeCumulative overhead time (s), labeled by badput_source.
Rolling Window Goodputworkload/interval_goodputworkload_interval_goodput$\frac{Productive time (s)}{each rolling window (window_size)(s)}$, labeled by goodput_source.
Rolling Window Badputworkload/interval_badputworkload_interval_badput$\frac{Overhead time (s)}{each rolling window (window_size)(s)}$, labeled by badput_source.
Total Elapsed Timeworkload/total_elapsed_timeworkload_total_elapsed_timeTotal wall-clock elapsed time since job start (s).
Max Productive Stepsworkload/max_productive_stepsworkload_max_productive_stepsHighest completed productive step count.
Disruption Countworkload/disruptionsworkload_disruptionsCumulative count of job disruptions.
Step Time Deviationworkload/step_time_deviationworkload_step_time_deviationStep duration deviation from ideal step time (s).
Ideal Step Timeworkload/performanceworkload_performanceConfigured or computed ideal step time (s).
Stepping Slice Efficiencyworkload/stepping_slice_efficiencyworkload_stepping_slice_efficiencyActive stepping slices vs. allocated slices (Pathways elastic workloads).
Available Slice Efficiencyworkload/available_slice_efficiencyworkload_available_slice_efficiencyAvailable healthy slices vs. allocated slices (Pathways elastic workloads).

Badput Breakdown Categories (BadputType)

Full details: Retrieve Badput Breakdown.

  • TPU_INITIALIZATION: Device discovery, slice initialization, and driver/buffer setup.
  • TRAINING_PREP: Checkpoint manager creation, mesh/model initialization, and optimizer setup.
  • PROGRAM_STARTUP: JAX tracing, XLA compilation, and runtime startup.
  • DATA_LOADING_SYNC: Blocking batch fetch time (DATA_LOADING_ASYNC tracks overlapped non-blocking loading without penalizing Goodput).
  • UNPRODUCTIVE_CHECKPOINT_SAVE_TIME / UNPRODUCTIVE_CHECKPOINT_RESTORE_TIME: Blocking checkpoint save/restore time (requires enable_checkpoint_cloud_logger=true with Orbax).
  • WASTED_PROGRESS_FROM_DISRUPTION / INFRASTRUCTURE_RECOVERY_FROM_DISRUPTION: Productive steps lost since the last checkpoint and infrastructure recovery time after a disruption.
  • CUSTOM_BADPUT_EVENTS / OTHER: Blocking non-training events (e.g., eval, SDC checks) and uncategorized overhead.

2. Run Pre-Training with Goodput Enabled

Prerequisites

  • Unique run_name per run: Always use a fresh run_name (or goodput_job_name) for each new experiment so goodput_<run_name> does not mix logs from earlier runs into cumulative Goodput.
  • Cloud Logging access scope: Nodes need Cloud Logging read/write access (https://www.googleapis.com/auth/cloud-platform).

Sample Script

Follow the MaxText Pre-Training on TPUs tutorial (llama3-8b) and append the Goodput flags:

python3 -m maxtext.trainers.pre_train.train \
  model_name=llama3-8b \
  run_name=${YOUR_JOB_NAME?} \
  base_output_directory=${BASE_OUTPUT_DIRECTORY?} \
  dataset_type=synthetic \
  steps=20 \
  enable_goodput_recording=true \
  monitor_goodput=true \
  enable_rolling_window_goodput=true \
  enable_checkpoint_cloud_logger=true \
  checkpoint_period=5

Key Flags (src/maxtext/configs/base.yml)

FlagDefaultDescription
enable_goodput_recordingfalseRecord job, step, and overhead timestamps to Cloud Logging (goodput_<run_name>).
monitor_goodputfalseStart background GoodputMonitor uploader on host 0 (TensorBoard + GCM).
enable_rolling_window_goodputtrueUpload rolling-window Goodput/Badput to GCM when monitor_goodput=true.
rolling_windows_seconds[3600, 86400, 259200, 432000]Rolling window sizes in seconds (1h, 1d, 3d, 5d).
enable_checkpoint_cloud_loggerfalseEnable Orbax structured Cloud Logger for checkpointing Badput breakdown.
goodput_upload_interval_seconds30Upload interval (s) for cumulative and rolling-window metrics.
enable_pathways_goodputfalseSet to true when running on Pathways.

3. Where to Find the Output

A. Training Log

Verify that the background uploaders started, published metrics, and flushed on exit:

  • Startup: Started Cumulative Goodput upload to Tensorboard & GCM in the background! and Started Rolling Window Goodput upload to Tensorboard & GCM in the background!
  • Periodic upload: gcp_metrics.py ... 'Sent Goodput metrics to GCM Monitoring.'
  • Shutdown: Flushed final metrics and safe exited from rolling window Goodput monitoring. and Flushed final metrics and safe exited from cumulative Goodput monitoring.

B. Google Cloud Logs Explorer

Open Logging > Logs Explorer (https://console.cloud.google.com/logs/query) and query goodput_<RUN_NAME>:

logName=("projects/<PROJECT_ID>/logs/goodput_<RUN_NAME>")
timestamp >= "2026-09-25T17:00:00-07:00"
AND timestamp <= "2026-09-25T19:00:00-07:00"

Each entry's jsonPayload contains the recorded event timestamps (job_start_time, tpu_init_start_time, training_prep_start_time, data_loading_start_time, step_start_time, step_count, job_end_time).

C. Google Cloud Metrics Explorer

Open Monitoring > Metrics Explorer (https://console.cloud.google.com/monitoring/metrics-explorer), switch to PromQL, and filter by workload_id="<RUN_NAME>":

label_replace(compute_googleapis_com:workload_goodput_time{workload_id="<RUN_NAME>"}, "m", "goodput_time", "", "")
or label_replace(compute_googleapis_com:workload_badput_time{workload_id="<RUN_NAME>"}, "m", "badput_time", "", "")
or label_replace(compute_googleapis_com:workload_total_elapsed_time{workload_id="<RUN_NAME>"}, "m", "total_elapsed_time", "", "")
or label_replace(compute_googleapis_com:workload_max_productive_steps{workload_id="<RUN_NAME>"}, "m", "max_productive_steps", "", "")
or label_replace(compute_googleapis_com:workload_disruptions{workload_id="<RUN_NAME>"}, "m", "disruptions", "", "")
or label_replace(compute_googleapis_com:workload_step_time_deviation{workload_id="<RUN_NAME>"}, "m", "step_time_deviation", "", "")
or label_replace(compute_googleapis_com:workload_performance{workload_id="<RUN_NAME>"}, "m", "performance", "", "")
or label_replace(compute_googleapis_com:workload_interval_goodput{workload_id="<RUN_NAME>"}, "m", "interval_goodput", "", "")
or label_replace(compute_googleapis_com:workload_interval_badput{workload_id="<RUN_NAME>"}, "m", "interval_badput", "", "")

D. Google Cloud Monitoring Dashboard

  1. In Monitoring > Dashboards (https://console.cloud.google.com/monitoring/dashboards), import ml_goodput_measurement/dashboards/goodput_dashboard.json.
  2. Filter the dashboard by workload_id: <RUN_NAME> over the run's time range to view Cumulative and Rolling Window Goodput/Badput breakdown charts.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.