Conversation
|
This was referenced Sep 29, 2026
Yuan-Xinyi
added a commit
that referenced
this pull request
Sep 29, 2026
Yuan-Xinyi
added a commit
that referenced
this pull request
Sep 29, 2026
This was referenced Sep 29, 2026
This branch has not been deployed
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
Replace the external
toppra==0.6.3dependency with an in-tree NumPy reference and batched Warp implementation. Joint paths can now be retimed on CPU or CUDA, with first-order PyTorch gradients through spline fitting, constraint solving and sampling to waypoints and velocity/acceleration limits.backend="auto" | "numpy" | "warp"andgrid_sizetoToppraPlannerCfg. Auto uses Warp on CUDA or when inputs require gradients, and NumPy for ordinary CPU planning. The existing NumPy worker-pool lifecycle remains intact.TIMEandQUANTITYsampling, scalar/per-joint/signed bounds, batched failure isolation, repeated waypoints, stationary paths and terminal padding. Preserve planner float32 outputs and quantity coercion. Promote float16 waypoint inputs before Warp dispatch while preserving gradients through the conversion.MotionGeneratorresampling. Honor the current Torch CUDA stream for forward and backward computation.scipydependency for the NumPy spline reference; reuse the existing Torch/Warp stack.Compatibility and limitations
The fitted uniform not-a-knot spline and legacy waypoint cleanup are preserved. Timing uses conservative continuous-interval constraints, so trajectories are not numerically identical to external TOPPRA. In a 64-case comparison against
toppra==0.6.3at the original baseline (818375250), success flags agreed on every case and compared spline geometry was identical. Across 8 smooth paths, duration changed by -0.103% to +0.221%; across 48 random paths, the median increase was 5.37% and the maximum was 14.13%. Tiny nonzero moves now retain positive duration instead of taking the old zero-duration shortcut.Gradients are first-order and local to the selected filtering, grid, sample-count and active-constraint branches. Higher-order gradients are unsupported. Explicit NumPy selection rejects gradient requests;
torch.no_grad()preserves ordinary planning.Motion-planning agent context now documents backend selection, gradient behavior and timing differences. Simulation-system context was reviewed and needs no edit because simulator ownership and lifecycle contracts are unchanged. Public export coverage remains complete. The float16 adapter correction restores the documented input-precision behavior, so the existing context needs no additional change.
Type of change
Validation
mainbaseline.toppraimports and successfully runs NumPy/Warp CPU retiming and backward propagation.1.3e-9.black .(26.3.1),git diff --check, API documentation coverage (2314/2314), and agent-context validation passed. Real-simulator tests and the full repository suite were not run; focused tests cover the changed numerical and adapter contracts.Focused test commands
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 WARP_CACHE_PATH=/tmp/embodichain-toppra-warp-cache MPLCONFIGDIR=/tmp/embodichain-toppra-mpl python -m pytest -q \ tests/compute/test_toppra.py tests/compute/test_imports.py \ tests/sim/motion/planners/test_toppra_batched.py \ tests/sim/motion/test_motion_generator_batched.py tests/sim/motion/test_motion_imports.py \ tests/test_agent_context_map.py tests/test_agent_context_tools.py \ tests/benchmark/motion_generation/test_motion_generation_benchmark.py::test_toppra_adapter_close_releases_planner \ -m 'not requires_sim and not gpu' PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 WARP_CACHE_PATH=/tmp/embodichain-toppra-warp-cache MPLCONFIGDIR=/tmp/embodichain-toppra-mpl python -m pytest -q \ tests/compute/test_toppra.py tests/sim/motion/planners/test_toppra_batched.py --run-gpu -m gpuScreenshots
Not applicable; this change affects numerical planning and autograd.
Checklist
black .command to format the code base.python docs/scripts/check_api_docs.py), if applicable.