Add extensible free-space motion benchmark - #451
Open
yuecideng wants to merge 17 commits into
Open
Conversation
Refactor the neural planner benchmark into configurable adapters, fixed scenarios, external metrics, artifacts, aggregation, and reporting. Add cuRobo as the primary baseline, optional IK/TOPPRA diagnostics, and a configurable NMG stub.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR replaces the previous monolithic NeuralPlanner benchmark with a new, extensible motion-generation benchmark framework centered on free-space cases and cuRobo as the primary baseline. It introduces suite-driven configuration, a registry-based adapter/scenario architecture, a generic runner with lifecycle timing phases, external validation metrics (ordered waypoint matching + motion-validity gate), and standardized artifacts/reporting (including a single Markdown report with exactly three tables).
Changes:
- Refactor benchmark implementation into modular motion-generation components (config/registry/runner/scenarios/metrics/aggregation/artifacts/reporting) and wire a new
embodichain benchmark motion-generationCLI subcommand. - Add deterministic
free-space-commonsmoke/coverage suite YAMLs and afree_spacescenario provider that generates stable manifests and start-state bins. - Extend planners to support the benchmark lifecycle and cleanup: add
CuroboPlanner.prepare_backend()for explicit backend warmup timing, and addToppraPlanner.close()so adapters can reliably release worker pools.
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/benchmark/planners/test_neural_planner_benchmark.py | Removes tests tied to the deleted monolithic NeuralPlanner benchmark implementation. |
| tests/benchmark/motion_generation/test_motion_generation_benchmark.py | Adds comprehensive unit tests covering ordered waypoint matching, outcome/aggregation semantics, reporting constraints (3 tables), adapter lifecycle, and runner gating. |
| tests/benchmark/motion_generation/init.py | Introduces test package for the new motion-generation benchmark suite. |
| scripts/benchmark/planners/neural_planner/run_benchmark.py | Removes the legacy monolithic NeuralPlanner benchmark runner. |
| scripts/benchmark/motion_generation/init.py | Adds package marker for the new motion-generation benchmark modules. |
| scripts/benchmark/motion_generation/run_benchmark.py | Adds the new CLI-compatible entry point supporting suite selection and overrides. |
| scripts/benchmark/motion_generation/config.py | Adds suite/config models, YAML loading, hashing utilities, and validation for free-space track parameters. |
| scripts/benchmark/motion_generation/registry.py | Adds registries for planner adapters and scenario providers. |
| scripts/benchmark/motion_generation/runner.py | Adds a generic benchmark runner with lifecycle timing, capability gating, artifact writing, aggregation, and report generation. |
| scripts/benchmark/motion_generation/aggregation.py | Adds aggregation logic for Time & Memory, Success & Metrics, and Leaderboard tables with case-macro averaging semantics. |
| scripts/benchmark/motion_generation/reporting.py | Adds Markdown reporting that always renders exactly three tables with stable schemas and formatted values. |
| scripts/benchmark/motion_generation/artifacts.py | Adds reproducibility artifacts: resolved suite YAML, environment metadata, case manifest, JSON aggregates, and JSONL trial records. |
| scripts/benchmark/motion_generation/metrics/init.py | Exposes metric helpers for performance timing and trajectory validation. |
| scripts/benchmark/motion_generation/metrics/performance.py | Adds timed-call measurement including CPU RSS (psutil), GPU allocator deltas, and optional peak GPU tracking. |
| scripts/benchmark/motion_generation/metrics/stats.py | Adds shared nearest-rank percentile helper. |
| scripts/benchmark/motion_generation/metrics/trajectory.py | Adds ordered waypoint matching, external motion-validity metrics, joint-limit checks, and path metrics. |
| scripts/benchmark/motion_generation/scenarios/init.py | Registers built-in scenarios for benchmark discovery. |
| scripts/benchmark/motion_generation/scenarios/base.py | Defines the ScenarioProvider contract for track case generation. |
| scripts/benchmark/motion_generation/scenarios/free_space.py | Adds deterministic free-space case generation for free-space-common (seed-stable manifests, bins, shapes). |
| scripts/benchmark/motion_generation/planners/init.py | Registers built-in planner adapters for benchmark discovery. |
| scripts/benchmark/motion_generation/planners/base.py | Defines PlannerAdapter lifecycle contract and metadata hashing/export. |
| scripts/benchmark/motion_generation/planners/curobo.py | Adds cuRobo adapter with explicit prepare phase and empty-world configuration. |
| scripts/benchmark/motion_generation/planners/ik_interpolate.py | Adds sequential IK + interpolation diagnostic adapter with per-env failure handling. |
| scripts/benchmark/motion_generation/planners/toppra.py | Adds IK+TOPPRA diagnostic adapter with optional dependency gating and explicit planner cleanup. |
| scripts/benchmark/motion_generation/planners/neural.py | Adds explicit unsupported NMG adapter stub with configurable internal eps values. |
| scripts/benchmark/motion_generation/suites/smoke.yaml | Adds smoke suite YAML for free-space-common with deterministic Franka manifests. |
| scripts/benchmark/motion_generation/suites/coverage.yaml | Adds coverage suite YAML expanding batch/path/bin/seed matrix. |
| scripts/benchmark/motion_generation/README.md | Adds usage and scope documentation for the new benchmark suite. |
| scripts/benchmark/motion_generation/BENCHMARK_DESIGN.md | Updates benchmark design doc references to the new module layout and CLI entry point. |
| scripts/benchmark/curobo_extraction/run_benchmark.py | Updates module run instruction to the new package path. |
| scripts/benchmark/curobo_extraction/init.py | Adds package marker for cuRobo extraction microbenchmark. |
| scripts/benchmark/main.py | Replaces the old planners-neural-planner subcommand with motion-generation and wires parser arguments. |
| pyproject.toml | Adds psutil>=5.9 dependency for process RSS measurement used in benchmark tooling. |
| embodichain/lab/sim/planners/toppra_planner.py | Adds explicit close() method and routes __del__ through it for reliable pool teardown. |
| embodichain/lab/sim/planners/curobo/curobo_planner.py | Adds prepare_backend() API to separate backend materialization/warmup from first plan timing. |
| docs/source/guides/cli.md | Updates CLI docs to reference the new motion-generation benchmark command. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR implements the first three benchmark steps discussed in #437:
free-space-commonsmoke and coverage suites with deterministic Franka case manifests;pos_epsandrot_epsindependently configurable from suite-owned external validation thresholds;Atomic-task remains out of scope for this PR and can be added through the extension points in a follow-up.
Dependencies: adds
psutil>=5.9for process RSS measurement.Partially addresses #437.
Type of change
Screenshots
Not applicable; this change provides a CLI benchmark and generated Markdown/JSON artifacts.
Validation
black .— 580 files unchangedblack --check --diff --color ./python -m compileall -q embodichain/lab/sim/planners/curobo/curobo_planner.py scripts/benchmark/__main__.py scripts/benchmark/planners/neural_planner tests/benchmark/planners/test_motion_generation_benchmark.pypytest -q tests/benchmark tests/sim/planners/test_curobo_planner.py -m 'not gpu and not slow'— 51 passed, 3 deselectedThe nightly-scale coverage matrix was not run locally.
Checklist
black .command to format the code base.