Repository navigation
Conversation
The render benchmark could only ever report renderer time. Add a benchmark_mode switch so the same scene can be measured either way. In "render" mode (the default, and what the task did before) the articulations are posed by writing joint positions straight into the simulation, so the frame a renderer is timed on is the analytic sinusoid and nothing has to be actuated to produce it. In "physics_render" mode the same poses are requested as actuator targets, so the solver does an ordinary task's tracking work. Measuring the second mode needs a physics timer, so add PHYSICS_PROFILE_SCOPE around the physics step in SimulationContext.step, gated by ISAACLAB_PHYSICS_PROFILE and mirroring the existing ISAACLAB_RENDER_PROFILE timer. benchmark_renderer.py selects the mode with --mode, sums the decimated physics steps that precede each rendered frame, and grows PHYSICS and TOTAL columns when a sweep has them.
|
There was a problem hiding this comment.
Isaac Lab Review Bot
The physics-plus-render benchmark plumbing is coherent, but render mode writes the analytic joint pose before the environment’s decimated physics steps. The camera therefore observes a subsequently integrated state rather than necessarily the exact pose promised by the new documentation.
- Design and architecture: The mode switch and profiling scope are consistently connected across task configuration, environment behavior, subprocess environment variables, timing parsing, and reporting. However, the render-mode design does not fully isolate the rendered pose from physics because the direct state write occurs in
_pre_physics_step, before physics integration. - API: The new mode values, profiling scope, CLI option, and additive JSON fields are kept consistent and covered by tests. The documented contract for
benchmark_mode="render"overstates the behavior by claiming the rendered scene is exactly the analytic sinusoid even though physics steps occur after the direct write. - Implementation: Physics timings are accumulated across decimated steps and paired with each render timing appropriately. The render-mode state path needs adjustment: apply the direct pose immediately before rendering if exact analytic poses are required, or revise the documentation and benchmark claims to describe the post-integration pose accurately.
Minor fixes needed. Posted 1 actionable finding inline.
Automated review; human maintainers own approval decisions.
Follows how isaac-sim#7702 handled ISAACLAB_RENDER_PROFILE: the timer is simply always on rather than gated behind a flag. Doing the same for ISAACLAB_PHYSICS_PROFILE removes the reason for everything --mode was carrying. Every log now has physics timings, so the parser no longer tracks whether a frame has them, the table no longer chooses its columns per run, and the test log writer no longer makes physics optional. The scene switch stays on BENCHMARK_MODE, read directly the way the profile env vars are. Both modes report physics, render, and total; the mode decides what the physics number means, not whether there is one.
Keep only the physics scope name, its pattern, and the env var that turns the timer on. Physics timings land in the run log next to the render ones; how they get summarized is a separate question from adding the timer, and reworking parse_log, build_record, and the results table to answer it here was scope this change did not need.
Greptile and the review bot both caught that render mode wrote the joint pose from _pre_physics_step, so decimation physics steps ran before the camera was read. The implicit drives were never retargeted and stayed active, and gravity and joint limits applied too, so the solver pulled the joints off the written pose and the renderer was timed on its output rather than the analytic one. Split the drive paths: _pre_physics_step now only advances the clock and, in physics_render mode, requests actuator targets. Render mode writes the pose in _get_observations instead, after the last physics step and just before the lazy camera read, with sim.forward() to propagate the joint write to the body transforms the renderer reads. The regression test asserts the call order across the step, so moving the write back ahead of physics fails it.
|
@greptile review |
Greptile caught that the post-physics joint write can miss the render. RenderContext.update_scene_state syncs at most once per physics step and sim.forward() does not advance that count, so with lazy_sensor_update off InteractiveScene.update has already stamped the current step and the lazy camera read reuses the transforms captured before the write. The task's default config leaves lazy_sensor_update on, so nothing had synced yet and the default path was already correct, but that is one config flag away from silently rendering the solver pose. reset_scene_state_cadence() is the documented hook for this and costs an extra sync only in the case that needs one.
|
@greptile review |
|
run-ci |
| """ | ||
|
|
||
| RENDER_SCOPE_PATTERN = re.compile(rf"{re.escape(RENDER_SCOPE)} took ([\d.]+) ms") | ||
| PHYSICS_SCOPE_PATTERN = re.compile(rf"{re.escape(PHYSICS_SCOPE)} took ([\d.]+) ms") |
There was a problem hiding this comment.
PHYSICS_SCOPE and PHYSICS_SCOPE_PATTERN seems to not be used anywhere, is that right?
There was a problem hiding this comment.
I've updated parse_log -> parse_frames to ingest these
There was a problem hiding this comment.
renamed to parse profile since this is no longer scraped from log
parse_log took one hardcoded regex, so PHYSICS_SCOPE_PATTERN was compiled and never read: the timer ran and its numbers sat in the log unsummarized. Scopes are now a name-to-pattern mapping, and a caller can pass its own to summarize a timer this script does not know about. Scopes cannot be collected independently and zipped. Decimation puts several physics steps in front of one render, so a non-frame scope accumulates until the frame scope closes it out; counting the steps as frames instead would report the cost of a single step and shift the samples the warm-up padding skips past. parse_frames carries that, and a scope missing from a log reads as zero, so a run captured without ISAACLAB_PHYSICS_PROFILE still parses. Render stays flat in the results, so build_record and the existing tests did not move. Physics and total ride along as sub-dicts, and the record picks up sub-dicts by shape rather than by name, so another scope reaches the JSON without further edits. The table gained PHYSICS and TOTAL, which meant rebuilding it from column pairs: its widths were baked into noqa'd string literals that adding a column would have rewritten anyway.
|
@greptile review |
|
run-ci |
|
run-ci |
|
run-ci |
|
run-ci |
1 similar comment
|
run-ci |
|
Backported to |
# Description Follow-up to #7702. Added direct-pose and actuator-driven workloads to the canonical Franka cabinet renderer benchmark, with physics and render timings available through the benchmark API and persisted reports. - `BENCHMARK_MODE=render` (default) writes the analytic joint pose after physics and before the camera read. `BENCHMARK_MODE=physics_render` sets actuator targets before physics. Both modes still step physics. - Direct posing requires lazy sensor updates. With Isaac RTX, it also rejects visualizers that pump the Kit app before the pose write; use `--visualizer none` or `physics_render`. - Runtime benchmarks collect synchronized scopes after warmup when the task has a non-`None` `benchmark_mode` and the corresponding `ISAACLAB_PHYSICS_PROFILE` / `ISAACLAB_RENDER_PROFILE` flag is enabled. Temporary wrappers restore the original methods on success or failure, so subsequent runs do not inherit profiling overhead or duplicate samples. - Schema **1.4 remains unchanged**. `BenchmarkResult.bundle.extra`, schema JSON, and OmniPerf output include per-call mean, standard deviation, maximum [ms], and call count under `physics_*` and `render_*`. Disabled scopes add no keys, and distributed metadata is preserved. - Ordered raw samples remain in local `profile_timings.json`, outside `output_paths`. The renderer sweep groups physics calls by rendered frame and reports render, physics, and combined statistics without scraping logs. Invalid profiling output errors propagate. ```bash uv run python scripts/benchmarks/benchmark_renderer.py 'newton_*' BENCHMARK_MODE=physics_render uv run python scripts/benchmarks/benchmark_renderer.py 'newton_*' ``` Scope timing synchronizes the device and changes execution overlap, so profiled runs are diagnostics. API/OmniPerf summaries cover all captured calls; the sweep additionally removes padding frames and reports per-frame statistics. Migration: collect scope timings through the runtime benchmark; normal simulations no longer install render timers from the profiling flag. Read scalar summaries from `bundle.extra` or raw `timings_ms` pairs from the local profiling file. The old `isaaclab.renderers.render_context.RENDER_PROFILE_SCOPE` import remains available with a deprecation warning; use `isaaclab.benchmark.stepping.RENDER_PROFILE_SCOPE`. ## Validation - Benchmark, renderer orchestration, task configuration, sweep, and runtime smoke tests: 398 passed, 1 skipped. - Regression tests failed before the fixes and passed afterward for profiling restoration, the deprecated scope import, and invalid direct-pose rendering configurations. - Real Newton GPU sweeps passed in both modes with 1 environment, 3 measured frames, and 64×64 resolution. Reported statistics were independently checked against raw samples. - Formatting and changelog checks passed against the current `develop` base. - Sphinx documentation built without warnings or errors using `uv run --isolated --extra dev -- make -C docs current-docs` with `SPHINXOPTS='-D viewcode_follow_imported_members=0'` to omit imported source-code links. ## Type of change - New feature - Bug fix - Breaking change: render profiling moved from normal simulation runs into the runtime benchmark - Documentation update ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks with `uv run isaaclab -f` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added a changelog fragment under `source/<pkg>/changelog.d/` for every touched package - [x] My name already exists in `CONTRIBUTORS.md` (cherry picked from commit 3714907)
Description
Follow-up to #7702. Added direct-pose and actuator-driven workloads to the canonical Franka cabinet renderer benchmark, with physics and render timings available through the benchmark API and persisted reports.
BENCHMARK_MODE=render(default) writes the analytic joint pose after physics and before the camera read.BENCHMARK_MODE=physics_rendersets actuator targets before physics. Both modes still step physics.--visualizer noneorphysics_render.Nonebenchmark_modeand the correspondingISAACLAB_PHYSICS_PROFILE/ISAACLAB_RENDER_PROFILEflag is enabled. Temporary wrappers restore the original methods on success or failure, so subsequent runs do not inherit profiling overhead or duplicate samples.BenchmarkResult.bundle.extra, schema JSON, and OmniPerf output include per-call mean, standard deviation, maximum [ms], and call count underphysics_*andrender_*. Disabled scopes add no keys, and distributed metadata is preserved.profile_timings.json, outsideoutput_paths. The renderer sweep groups physics calls by rendered frame and reports render, physics, and combined statistics without scraping logs. Invalid profiling output errors propagate.Scope timing synchronizes the device and changes execution overlap, so profiled runs are diagnostics. API/OmniPerf summaries cover all captured calls; the sweep additionally removes padding frames and reports per-frame statistics.
Migration: collect scope timings through the runtime benchmark; normal simulations no longer install render timers from the profiling flag. Read scalar summaries from
bundle.extraor rawtimings_mspairs from the local profiling file. The oldisaaclab.renderers.render_context.RENDER_PROFILE_SCOPEimport remains available with a deprecation warning; useisaaclab.benchmark.stepping.RENDER_PROFILE_SCOPE.Validation
developbase.uv run --isolated --extra dev -- make -C docs current-docswithSPHINXOPTS='-D viewcode_follow_imported_members=0'to omit imported source-code links.Type of change
Release backport
developChecklist
uv run isaaclab -fsource/<pkg>/changelog.d/for every touched packageCONTRIBUTORS.md