Proposal: Adopt uv as the standard Python package manager for Autoware via colcon-uv #7117
Replies: 3 comments 3 replies
-
|
Does |
Beta Was this translation helpful? Give feedback.
-
|
Does anyone have any thoughts on this matter? |
Beta Was this translation helpful? Give feedback.
-
|
I'd love to have uv support in Autoware project! But it is not part of apt packages like I'd suggest:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Motivation
As Autoware's Python ecosystem grows — from neural-network-based planners to 3DGS (3D Gaussian Splatting) simulators — we increasingly need a fast, reproducible, and isolation-aware Python package manager. The current approach mixes
pip,pipx, manualvenv, and apt-installedpython3-*packages, which creates several pain points:Slow dependency resolution: Installing heavy ML stacks (PyTorch, transformers, flash-attn, TensorRT bindings) via
pipis slow.uvis 10-100x faster thanpipfor resolution and installation.Fragile isolation: Today, only
acadosuses a dedicated venv (/opt/acados/.venv). New Python-heavy packages (3DGS renderers, Alpamayo VLM planner) need their own isolated environments without conflicting with each other or system ROS packages.No standard for Python-native ROS 2 packages: ROS 2's default
ament_pythonbuild type relies on legacysetup.py/setup.cfg. Modern Python packages usepyproject.tomlwith PEP 517/518 build backends (e.g.,uv_build,hatchling). We lack a bridge betweencolcon buildand these modern packages.Proposal
Adopt uv as the standard Python package manager for Autoware, integrated through colcon-uv.
1.
colcon-uv: Bridginguvand ROS 2colcon-uv is a colcon extension developed by TIER IV that enables building and testing
uv-managed Python packages withincolcon buildworkflows. It:[tool.colcon-uv-ros]in theirpyproject.toml--system-site-packages(sorclpy,geometry_msgs, etc. remain accessible)uv pip install(fast!)ros2 run/ros2 launchcompatibility[tool.uv]overrides and PEP 735 dependency groupsExample
pyproject.tomlfor a colcon-uv package:2. Concrete Use Case: 3DGS-Based Simulator (SplatSim)
We are working on integrating a 3D Gaussian Splatting renderer as a camera simulator for Autoware (feat/splatsim branch). This package:
uv's fast resolution when rebuilding environmentscolcon-uvis already being installed in this branch (ansible/roles/ros2_dev_tools/tasks/main.yaml) to manage this integration.3. Concrete Use Case: alpamayo-autoware (End-to-End VLM Planner)
alpamayo-autoware wraps NVIDIA's Alpamayo 1.5 vision-language model as a ROS 2 node for end-to-end trajectory planning. Its Python dependency stack is substantial:
torch==2.8.0,transformers==4.57.1,flash-attn,tensorrt,physical_ai_avalpamayo1_5/) already usesuv_buildas its build backend anduv sync/uv venvfor environment managementalpamayo_ros/) currently usesament_pythonbut could be unified undercolcon-uvWith colcon-uv, the entire alpamayo-autoware repository could be built with a single
colcon build, resolving both pip-managed ML dependencies and ROS system packages seamlessly.4. Improving Existing venv Management (acados)
The current acados Ansible role manually manages a Python virtual environment through a multi-step imperative process:
This works, but has several drawbacks:
casadiandsympyversions are unpinned — builds are not reproducible across time/opt/acados/.venvis invisible to the ROS 2 build system, requiring manual.bashrcenvironment variable injection (CMAKE_PREFIX_PATH,LD_LIBRARY_PATH,ACADOS_SOURCE_DIR)With
uv+colcon-uv, this could become a declarativepyproject.toml:Benefits:
uv.lockensures reproducible builds with exact pinned versionsuvcaching makes reinstallation near-instant (seconds vs minutes)colcon buildhandles venv creation, dependency resolution, and installation.bashrchacks — colcon environment hooks handle paths automaticallyBenefits Summary
uv+colcon-uvpip(minutes for large stacks)uv(seconds)ament_python+setup.pycolcon-uv+pyproject.toml(PEP 517)uv.lockper packagepyproject.tomlwith overridesMigration Path
colcon-uvin dev tooling and migrateacadosvenv setup tocolcon-uv-managedpyproject.toml. Validate that the new declarative approach reproduces the current behavior.colcon-uvin place, Python-heavy packages such as 3DGS-based simulators (SplatSim) and end-to-end VLM planners (alpamayo-autoware) can be integrated into the Autoware workspace via a singlecolcon build, with fast dependency resolution, per-package isolation, and reproducible lockfiles out of the box.Questions for Discussion
uvas a build-time dependency?colcon-uvto be upstreamed into colcon's official extension set?>=3.11for some features?Looking forward to hearing the community's thoughts!
Beta Was this translation helpful? Give feedback.
All reactions