Skip to main content
QUICK REVIEW

[Paper Review] OptimizedDP: An Efficient, User-friendly Library For Optimal Control and Dynamic Programming

B. Minh, Hu, Hanyang|arXiv (Cornell University)|Apr 12, 2022
Reinforcement Learning in RoboticsComputer Science6 citations
TL;DR

OptimizedDP is a high-performance, user-friendly Python library that accelerates dynamic programming and optimal control computations using HeteroCL and TVM-based code generation. It achieves up to 789× speedup over pure Python for value iteration and enables reachability analysis in up to six dimensions, significantly outperforming MATLAB and C++ toolboxes.

ABSTRACT

This paper introduces OptimizedDP, a high-performance software library for several common grid-based dynamic programming (DP) algorithms used in control theory and robotics. Specifically, OptimizedDP provides functions to numerically solve a class of time-dependent (dynamic) Hamilton-Jacobi (HJ) partial differential equations (PDEs), time-independent (static) HJ PDEs, and additionally value iteration for continuous action-state space Markov Decision Processes (MDP). The computational complexity of grid-based DP is exponential with respect to the number of grid or state space dimensions, and thus can have bad execution runtimes and memory usage whenapplied to large state spaces. We leverage the user-friendliness of Python for different problem specifications without sacrificing the efficiency of the core computation. This is achieved by implementing the core part of the code which the user does not see in heterocl, a framework we use to abstract away details of how computation is parallelized. Compared to similar toolboxes for level set methods that are used to solve the HJ PDE, our toolbox makes solving the PDE at higher dimensions possible as well as achieving an order of magnitude improvements in execution times, while keeping the interface easy for specifying different problem descriptions. Because of that, the toolbox has been adopted to solve control and optimization problems that were considered intractable before. Our toolbox is available publicly at https://github.com/SFU-MARS/optimized_dp.

Motivation & Objective

  • Address the lack of efficient, user-friendly tools for continuous-state MDP value iteration and Hamilton-Jacobi PDE solving in robotics and control.
  • Overcome the scalability limitations of existing toolboxes like MATLAB-based ToolboxLS and HelperOC, which are slow and limited to 4D problems.
  • Provide a high-performance alternative to BEACLS by combining C++/CUDA-level speed with Python-level usability for system specification.
  • Enable practical reachability analysis for high-dimensional systems (up to 6D) by optimizing numerical algorithms for performance without sacrificing ease of use.
  • Bridge the gap between prototyping efficiency and computational efficiency in dynamic programming-based optimal control and reachability analysis.

Proposed method

  • Implement core algorithms—HJ PDE solving, BRT/BRS computation, time-to-reach, and value iteration—using a Python frontend for problem specification and HeteroCL for high-performance backend execution.
  • Leverage HeteroCL, a Python-based DSL built on TVM, to decouple algorithm definition from low-level scheduling and optimization.
  • Apply TVM’s graph-level optimizations and custom scheduling transformations to accelerate memory access and floating-point operations in high-dimensional grids.
  • Use ENO (Essentially Non-Oscillatory) schemes for accurate derivative approximation in HJ PDE solvers, supporting both first- and second-order accuracy.
  • Support continuous state and action spaces in MDP value iteration by implementing iterative dynamic programming on structured grids.
  • Integrate GPU acceleration via CUDA in HeteroCL to accelerate computation on large-scale grids, especially for 5D and 6D problems.

Experimental results

Research questions

  • RQ1Can a Python-based library achieve performance comparable to C++/CUDA toolboxes like BEACLS while maintaining ease of use for system modeling?
  • RQ2To what extent can HeteroCL and TVM-based code generation accelerate dynamic programming algorithms on high-dimensional grids?
  • RQ3Can the library scale to 6D systems for reachability analysis, where prior tools fail due to computational limits?
  • RQ4How does the performance of value iteration in OptimizedDP compare to pure Python implementations for continuous MDPs?
  • RQ5What is the trade-off between numerical accuracy and computational speed when using different order ENO schemes in HJ PDE solvers?

Key findings

  • OptimizedDP achieves up to 789× speedup over pure Python for 3D value iteration on a 50×50×30 grid, reducing runtime from 773 seconds to 0.98 seconds.
  • For 5D HJ PDE solving with a 40⁵ grid, OptimizedDP runs in 0.98 seconds, outperforming BEACLS (8.28 seconds) by a factor of 8.44 with second-order ENO.
  • The library enables reachability analysis for 6D systems, such as underwater vehicle tracking, which previous toolboxes could not handle due to computational constraints.
  • In 3D HJ PDE solving, OptimizedDP achieves a 32× speedup over MATLAB-based ToolboxLS and a 10× speedup over HelperOC, with a maximum solution difference of 1.4×10⁻⁶.
  • The implementation maintains high numerical accuracy, with maximum differences from reference solutions below 10⁻⁶ for HJ PDEs and under 0.25 for value iteration.
  • The combination of HeteroCL and TVM enables efficient code generation and scheduling, making high-performance numerical computation accessible via a high-level Python interface.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.