Introduction
Markov Decision Processes (MDPs) serve as the mathematical foundation for decision-making under uncertainty, with applications ranging from autonomous traffic control to financial modeling. However, real-world systems often face the "curse of dimensionality," where the state space grows exponentially with complexity. Researchers have traditionally faced a difficult choice: use accessible but non-scalable Python tools like pymdptoolbox, employ high-performance but rigid C++ solvers, or abandon exact solutions in favor of function approximation methods common in Reinforcement Learning, which can introduce sub-optimality.
To address these challenges, we introduce madupite, a new high-performance, distributed solver designed to tackle "gigantic" MDPs that were previously unsolvable without sacrificing accuracy. By combining a C++ core with a user-friendly Python API, it allows researchers to distribute massive computational loads across supercomputing clusters.
Architecture and Methodology
The technical core of madupite is designed for maximum efficiency and scalability. Its performance is rooted in several key architectural choices:
- Inexact Policy Iteration (iPI): Unlike standard policy iteration, which requires solving a massive linear system exactly at every step, iPI introduces "inexactness" during the policy evaluation phase. This allows the solver to be significantly faster and more scalable while maintaining convergence to an optimal solution.
- PETSc Integration: The core is built on the Portable, Extensible Toolkit for Scientific Computation (PETSc), a robust C library used in high-end physics and engineering simulations. PETSc provides madupite with highly optimized sparse linear algebra routines and native support for the Message Passing Interface (MPI), enabling computation across hundreds of CPU cores.
- Hybrid Language Support: While the heavy lifting is done in C++20, the library utilizes
nanobindto provide a seamless Python API. This allows researchers to define models in Python while executing the solve at C++ speeds on supercomputing clusters. - Customizable Inner Solvers: Users can tune the level of "inexactness" and choose from various inner solvers to find the best fit for their specific problem structure.
Key Features and Scalability
madupite abstracts the complexities of distributed computing—such as MPI and manual memory management—allowing domain experts to leverage high-performance computing (HPC) resources without specialized parallel programming knowledge. The framework is designed to load offline data or interface with online simulations to build and solve MDPs on the fly.
Key results and capabilities include:
- Massive Scalability: The solver is designed to handle MDPs with more than a million states, surpassing the memory and time limitations of traditional single-machine solvers.
- Distributed Memory: By leveraging PETSc, the software distributes the memory load of transition matrices across multiple nodes, overcoming the RAM constraints of individual machines.
- Accessibility: The software is available via
pip, making high-performance distributed computing accessible to the broader Python scientific community.
Limitations and Future Work
Currently, madupite is specialized for infinite-horizon discounted MDPs with finite state and action spaces. It is not yet designed for continuous state spaces or average-reward criteria without prior discretization. Furthermore, while it uses memory-efficient sparse linear algebra, its performance gains are most pronounced when transition matrices are sparse. Future development may expand support to broader classes of MDPs and deeper integration with online simulation environments.
Summary updated