Skip to content

Instrument evaluation with timers - #1145

Draft
alexmillane wants to merge 2 commits into
mainfrom
alex/poc/timing
Draft

Instrument evaluation with timers#1145
alexmillane wants to merge 2 commits into
mainfrom
alex/poc/timing

Conversation

@alexmillane

@alexmillane alexmillane commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Times the evaluation pipeline using the merged Timer utility.

Detailed description

  • We would like to measure the performance of sections of the code over time. The Timer utility this builds on has since landed on main, so this branch now only adds the instrumentation.
  • Wraps Experiment Runner config load, run execution and report build, plus each Run's environment build, policy build, rollout and cleanup, and the per-step policy inference, env step, reset and metrics.
  • Adds EnvStepTimerWrapper beneath the video recorders so the recording cost (camera frame writes and encoder finalize) separates from the env step itself.
  • Writes arena_experiment_timings.json beside each Experiment Runner output, and the OSMO collect task merges every completed Run's timings into one Experiment-level file with per-timer totals.

@cvolkcvolk cvolkcvolk mentioned this pull request Aug 26, 2026
cvolkcvolk added a commit that referenced this pull request Aug 27, 2026
## Summary
Add a reusable timer utility

## Detailed description
- Extract Alex's timer utility and focused tests from #1145.
- Provide named wall-time statistics, NVTX ranges, optional CUDA
synchronization, table output, and JSON helpers.
- Leave experiment, policy, video, and OSMO instrumentation out of this
PR.
- Existing runtime behavior is unchanged until callers adopt the
utility.

---------

Signed-off-by: alex <amillane@nvidia.com>
Signed-off-by: Clemens Volk <cvolk@nvidia.com>
Co-authored-by: alex <amillane@nvidia.com>
- Copy the nvblox_next Timer into isaaclab_arena/utils/timer.py, adding a
  JSON writer and a cross-process merge helper for combining per-Run records.
- Instrument the Experiment Runner at three levels: Experiment phases, per-Run
  environment/policy construction and rollout, and the per-step policy and env
  calls in rollout_policy.
- Print a timing table at the end of an Experiment and write the same data to
  arena_experiment_timings.json beside arena_experiment_result.json.
- Collect each completed Run's timings in the OSMO output stage and aggregate
  them into one Experiment timings file holding per-Run records and totals.

Signed-off-by: alex <amillane@nvidia.com>
- Add EnvStepTimerWrapper, a gym wrapper that records the wall time of the env
  below it, and insert it under the recorders in wrap_env_for_video so
  rollout/env_step_without_video excludes all recording work.
- Time the camera recorder's per-step frame copy and encoder writes as
  video/camera_frame_write, and its per-episode encoder shutdown as
  video/camera_finalize.
- The viewport recorder's render cost is the remainder between the outer
  rollout/env_step and these timers.

Signed-off-by: alex <amillane@nvidia.com>
@alexmillane alexmillane changed the title Add Timers Instrument evaluation with timers Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant