AlpaSim is an autonomous vehicle simulator built as a collection of microservices that communicate via gRPC. This architecture enables horizontal scalability and allows different components to be deployed and scaled independently.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/NVlabs/alpasim/llms.txt
Use this file to discover all available pages before exploring further.
Core principles
AlpaSim is designed around three core principles:- Sensor fidelity - High-quality sensor simulation for realistic testing
- Horizontal scalability - Microservices can be replicated based on computational needs
- Hackability for research - Python implementation accessible to researchers
Real-time and very precise physics are non-goals of AlpaSim. The simulator prioritizes sensor fidelity and scalability over physics accuracy.
Microservices overview
The simulator consists of the following core services:- Runtime - Drives the simulation loop and coordinates all services
- Driver - Runs the egovehicle policy network (the autonomous driving model)
- Controller - Models vehicle controller and dynamics
- Physics - Applies ground constraints to keep vehicles on the road
- Sensorsim - Neural Rendering Engine (NRE) for sensor simulation
- Trafficsim - Neural traffic simulator for non-ego actors (coming soon)
- Eval - Evaluation module that processes logs to compute metrics
src/grpc/.
Data flow
The simulation follows a logical flow through each timestep:Simulation loop steps
- Wizard sets up the simulation configuration and launches the microservices
- Runtime maintains the world state and orchestrates the simulation loop
- World state (bounding boxes) is sent to Trafficsim to actuate non-ego actors
- World state is used by Sensorsim (NRE) to render camera frames for the ego vehicle
- Driver uses sensor readings to make driving decisions and plan trajectories
- Planned path is sent to Controller which models vehicle dynamics and provides egomotion
- Both ego and actor actuations are sent to Physics which applies ground constraints
- Updated state returns to Runtime which logs it and continues the loop
- Eval module processes logs after simulation to compute metrics
The runtime acts as a central hub for all communications and can function as a load balancer between service replicas.
Deployment architecture
The software implementation places the runtime at the center as a node for all communications:- Runtime is a gRPC client that must know the addresses of all other microservices
- Other services are server daemons that make no requests of their own
- Services can be replicated according to computational requirements:
- Typical load:
ego policy > sensor sim > controller sim > traffic sim > physics sim
- Typical load:
Deployment options
Containers can be run on arbitrary machines as long as:- Runtime knows all service addresses
- Filesystem mounts contain necessary files
- Network connectivity exists between services
- Single-machine deployment via
docker compose - Multi-machine deployment via
slurm - Custom deployments with manual service orchestration
Source code
The microservices can be found in the source repository:/src/runtime- Simulation runtime/src/driver- Driving policy service/src/controller- Vehicle controller + model/src/physics- Ground-mesh interaction modeling/src/eval- Evaluation framework/src/grpc- gRPC protocol definitions