Drax solves optimal control problems of the form
on GPU or other accelerator hardware.
Drax targets applications in robotics and model predictive control, leading to the following emphasis:
- Fast iteration times over precise convergence. MPC problems are rarely solved to convergence, so we care more about arriving at a reasonable solution quickly.
-
Complex dynamics constraints. The constraint
$x_{t+1} = f(x_t, u_t)$ is often the most difficult and nonlinear part of the problem. -
GPU friendly operations. Hardware accelerators are good at large matrix
multiplications like (e.g.,
$y = Ax$ ), but not so good at matrix inversions and linear solves (e.g.,$x = A^{-1}y$ ). This makes standard non-convex optimization methods like SQP less attractive on GPU. -
Support for sampling-based approximations. The dynamics gradients
(
$\nabla_x f, \nabla_u f$ ) are often poorly defined or difficult to compute. Drax supports gradient-free optimization via randomized smoothing.
Set up a conda env with Cuda 12.3 support (first time only):
conda env create -n [env_name] -f environment.ymlEnter the conda env:
conda activate [env_name]Install dependencies:
pip install -e . --find-links https://storage.googleapis.com/jax-releases/jax_cuda_releases.htmlSet up pre-commit hooks:
pre-commit autoupdate
pre-commit installRun unit tests:
pytestOther demos can be found in the examples folder.