Use the benchmark API
This guide is for automation authors who need to run supported benchmarks from Python, consume typed results, or add a benchmark producer. For day-to-day benchmarking, start with the CLI workflows and interpretation guidance in Run benchmarks. To isolate one asset method, cached property, or sensor update, use Write micro-benchmarks.
Run one workflow
Use a typed request for a supported workflow. It applies the same launch, task, timing, schema, and output behavior as the CLI. The following runtime example measures 1000 steps after 50 warm-up steps. It disables visualizers and requests both stable schema and human-readable summary output:
Run the file through the Isaac Lab Python wrapper:
The command prints the summary report. The paths in result.output_paths
identify the schema and summary JSON files that were written. Use these paths in
automation instead of reconstructing the timestamped names.
With a non-None task benchmark_mode and ISAACLAB_RENDER_PROFILE=1 or
ISAACLAB_PHYSICS_PROFILE=1, the runtime workflow also includes scalar profiling
summaries in result.bundle.extra: physics_mean_ms, physics_std_ms,
physics_max_ms, physics_calls, and the corresponding render_* keys.
These report mean, standard deviation, maximum time per call [ms], and call count
over the captured samples. Disabled scopes contribute no keys. The summaries are
included in schema and OmniPerf output without changing schema version 1.4.
Raw ordered samples remain in <output_path>/profile_timings.json for local analysis.
Choose a request
Choose the request and dedicated runner that match the measurement question.
~isaaclab.benchmark.run_benchmark accepts any request type when generic
dispatch is more convenient.
The examples below reuse the runtime workflow’s output and launcher objects.
Startup profiling records wall time and the most expensive functions for each phase:
Training returns the checkpoint produced by the selected RL library:
Pass the persisted checkpoint_path to a play request in a new
process:
Configure a request
All requests share the task identifier, optional environment count and seed, task configuration, output configuration, and launcher configuration.
Training exposes additional learning, video, sensor capture, and convergence
options. Training and play also expose backend_args for options that truly
belong to one RL library. Use typed fields, presets, and hydra_args for
supported options. backend_args bypasses the common request contract.
See the isaaclab.benchmark API reference for the exhaustive field list.
An empty visualizers tuple explicitly disables every visualizer. None
preserves task and environment defaults. Enabling cameras, rendering,
livestreaming, deterministic behavior, or animation recording changes the
workload and must be kept identical across compared runs.
Choose output formats
Select one or more formatter names in
~isaaclab.benchmark.BenchmarkOutputConfig:
Use ("schema", "summary") for results intended for review or publication.
The summary gives immediate feedback. The schema preserves typed data for
analysis. With multiple formatters, each output filename includes its formatter
name, so JSON outputs cannot overwrite each other.
Read the result
Every workflow returns ~isaaclab.benchmark.BenchmarkResult with two
members:
bundleis a~isaaclab.benchmark.RuntimeBundle,~isaaclab.benchmark.StartupBundle,~isaaclab.benchmark.TrainingBundle, or~isaaclab.benchmark.PlayBundle.output_pathsis the exact tuple ofpathlib.Pathobjects written by the selected formatters.
Consume typed fields rather than scraping terminal text or depending on keys in
bundle.extra:
The common run, versions, and hardware fields carry the comparison
context. runtime separates collection throughput, total throughput, startup
time, and environment-step timing. For measurement definitions, see
Run benchmarks. See the public API reference for every
schema field.
Handle errors and process lifetime
If a workflow parser rejects a typed request, the API raises ValueError. If
a workflow exits without returning a result, the API raises RuntimeError.
Invalid output configuration also raises an error. Examples include an empty
formatter tuple and an unknown formatter.
Run each workflow in a separate process. This gives each benchmark a clean
simulator lifecycle and prevents state from carrying over between workflows. It
also matches the CLI execution model. Process startup is reported separately
from steady-state throughput. Save result.bundle.checkpoint_path before
starting playback.
measure_synchronized_step_breakdown=True inserts device
synchronizations around environment and simulation step boundaries. This
serializes work and changes the schedule being measured, especially on
Newton. Every rate from that run is diagnostic and must not be reported as
throughput. Time outside SimulationContext.step() includes required
action, actuator, state, manager, reset, wrapper, and synchronization work.
It is not equivalent to removable Isaac Lab overhead.
Add a custom producer
Use ~isaaclab.benchmark.BaseIsaacLabBenchmark when a producer’s
lifecycle cannot be represented by a supported workflow. The framework provides
phases, typed measurement and metadata records, system recorders, and
formatters. You must define the timing boundary.
This executable example measures a CPU workload, records the sample distribution and configuration, updates system recorders, and always finalizes the benchmark:
Choose a meaningful phase name and state units explicitly. Warm up before sampling. Report the sample count with the mean and standard deviation. For GPU work, state whether the metric is submission latency or synchronized completion latency. Place synchronization at deliberate boundaries.
When a custom producer creates one of the stable workflow bundles, call
attach_bundle(bundle) before finalize() and select schema. Otherwise,
use the lower-level json representation. finalize() stops optional Kit
frametime recorders and gathers recorder data. It writes every selected
formatter and returns the paths written.
With use_recorders=True (the default), the base class captures CPU, GPU,
memory, and version metadata. Call update_manual_recorders() at least once
before finalize(), and update during long workloads when current utilization
samples are needed.
Set frametime_recorders=True only when a Kit application is running and the
workload needs physics, render, application, or GPU frametime data. The
framework enables the available Isaac Sim benchmark services and skips
unavailable recorders. Frametime instrumentation is part of the workload. Keep
its setting fixed across comparisons.
Choose a lower-level runner
~isaaclab.benchmark.MethodBenchmarkRunner repeats one method or
property across input modes, warm-up steps, and instance counts. Use
~isaaclab.benchmark.measure_latency to define paired host-submission
and device-synchronized timing boundaries. Use
~isaaclab.benchmark.LatencyBenchmarkRunner to report those structured
latency samples. Neither isolated result predicts end-to-end environment or
training throughput. The command matrices and extension protocol are in
Write micro-benchmarks.
Troubleshooting
Run scripts through ./isaaclab.sh -p so the Isaac Lab and simulator Python
environment is active. If output is missing, inspect returned output_paths
and make sure custom producers call finalize(). Formatter names are lowercase
and case-sensitive. Valid names are schema, summary, json, osmo,
and omniperf.
Missing GPU metadata usually means nvidia-smi or CUDA device discovery is
unavailable. Missing Kit frametime measurements can instead mean the relevant
benchmark service is not present. It does not invalidate non-frametime phases.
For a new supported end-to-end workflow, keep typed request construction, dispatch, schema output, summary output, and CLI behavior aligned. For an isolated operation, follow Write micro-benchmarks before adding a new runner or timing convention.