Add benchmarking for Relation Solver - #1086
Conversation
ca1b69a to
dd5389e
Compare
Greptile SummaryAdds a relation-solver benchmarking framework with synthetic solver/placer workloads, environment build/reset measurements, multi-GPU execution, capacity search, and JSON/CSV reporting.
Confidence Score: 4/5The environment benchmark’s printed latency must be corrected before merging because it reports build-only time alongside throughput calculated from build plus reset. Environment measurements capture build and reset separately, but the terminal table presents only build latency under a generic median column while deriving throughput from the combined duration, making the default report internally inconsistent. Files Needing Attention: isaaclab_arena/relations/benchmark/reporting.py Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
CLI[Benchmark CLI] --> Scenarios[Scenario matrix]
Scenarios --> Solver[RelationSolver target]
Scenarios --> Placer[ObjectPlacer target]
Scenarios --> Environment[Environment build/reset target]
CLI --> Workers[Per-GPU workers]
Workers --> Solver
Workers --> Placer
Workers --> Environment
Solver --> Measurements[Benchmark measurements]
Placer --> Measurements
Environment --> Measurements
Measurements --> Table[Terminal table]
Measurements --> JSON[JSON report]
Measurements --> CSV[CSV report]
Measurements --> Capacity[Capacity search]
Reviews (1): Last reviewed commit: "add software meta" | Re-trigger Greptile |
| median_ms = { | ||
| "solver": result.solve_ms, | ||
| "placer": result.place_ms, | ||
| "environment": result.build_ms, | ||
| }[result.target] |
There was a problem hiding this comment.
Environment latency excludes reset
When an environment benchmark is printed, median_ms contains only build_ms while throughput uses build_ms + reset_ms, causing the default report to understate end-to-end latency and show a latency that cannot be reconciled with its env/s value.
| median_ms = { | |
| "solver": result.solve_ms, | |
| "placer": result.place_ms, | |
| "environment": result.build_ms, | |
| }[result.target] | |
| median_ms = { | |
| "solver": result.solve_ms, | |
| "placer": result.place_ms, | |
| "environment": ( | |
| result.build_ms + result.reset_ms | |
| if result.build_ms is not None and result.reset_ms is not None | |
| else None | |
| ), | |
| }[result.target] |
| loss_history.append(loss.item()) | ||
|
|
||
| assert self._last_loss_per_env is not None | ||
| if self._last_loss_per_env.max().item() < self.params.convergence_threshold: |
There was a problem hiding this comment.
🟡 Convergence semantics changed for every solver caller
This switches the stop condition from aggregate mean loss to per-env max loss (and adds a full _compute_total_loss after the loop), so every batched RelationSolver.solve() in the framework — not just benchmarks — now keeps iterating until the worst environment converges and pays an extra forward pass per solve. For num_envs > 1 that generally means more iterations and shifted placement/reset behavior on the default path. Is this intended to ride along in a benchmarking PR? If so, it seems worth calling out in the PR description, since it changes behavior for all placement callers, not only the benchmark.
| gym.registry.pop(arena_env.name, None) | ||
|
|
||
|
|
||
| def run_environment_benchmark( |
There was a problem hiding this comment.
🟡 Sim-spinning benchmark inside the sim-free relations package
run_environment_benchmark builds a full Arena env, resets it, and closes it — real sim lifecycle orchestration — and it's exported from isaaclab_arena.relations.benchmark, a domain package that's otherwise kept simulator-free. The deferred imports keep the import graph clean, but the responsibility of owning a live env belongs to the runtime/example layer, not the relations domain. Would a top-level benchmarks area (or the examples package) be a better home for this piece, so the relations public API doesn't gain a sim entry point?
🤖 Isaac Lab-Arena Review BotSummaryThis PR adds a relation-solver benchmarking subsystem: a sim-free measurement library under Design, Boundaries & Scope
Findings🟡 Warning: relation_solver.py:300 — convergence criterion changed to per-env max loss for all solver callers; call out the default-path change. (Note: Greptile already flagged Test CoverageExcellent unit coverage — scenario validation, seeding/determinism, timing with injected clocks, multi-GPU aggregation, capacity search, report round-trips, and the worker CLI ( VerdictMinor fixes needed |
Signed-off-by: zhx06 <zihaox@nvidia.com>
Signed-off-by: zhx06 <zihaox@nvidia.com>
Signed-off-by: zhx06 <zihaox@nvidia.com>
Signed-off-by: zhx06 <zihaox@nvidia.com>
Signed-off-by: zhx06 <zihaox@nvidia.com>
Signed-off-by: zhx06 <zihaox@nvidia.com>
dd5389e to
4b73173
Compare
Signed-off-by: zhx06 <zihaox@nvidia.com>
Signed-off-by: zhx06 <zihaox@nvidia.com>
Summary
Add benchmarking for Relation Solver
Detailed description
solvermeasures one seededRelationSolver.solve()call;placermeasuresObjectPlacer.place()including candidate generation, retries, and validation.Local benchmark results
Command:
/isaac-sim/python.sh isaaclab_arena_examples/relations/relation_solver_benchmark.py --suite comprehensiveHardware: NVIDIA RTX 6000 Ada (48 GiB), PyTorch 2.10.0, CUDA 12.8
Runtime: 456 seconds
Batch-size Scaling
Fixed Workload: 3 objects.
Object-count Scaling
Fixed workload: batch size 1.
Environment Bring-up