Differentiable optimization has attracted significant research interest, particularly for quadratic programming (QP). Existing approaches for differentiating the solution of a QP with respect to its defining parameters often rely on specific integrated solvers. This integration limits their applicability, including their use in neural network architectures and bi-level optimization tasks, restricting users to a narrow selection of solver choices. To address this limitation, we introduce dQP, a modular and solver-agnostic framework for plug-and-play differentiation of virtually any QP solver. A key insight we leverage to achieve modularity is that, once the active set of inequality constraints is known, both the solution and its derivative can be expressed using simplified linear systems that share the same matrix. This formulation fully decouples the computation of the QP solution from its differentiation. Building on this result, we provide a minimal-overhead, open-source implementation ( https://github.com/cwmagoon/dQP ) that seamlessly integrates with over 15 state-of-the-art solvers. Comprehensive benchmark experiments demonstrate dQP's robustness and scalability, particularly highlighting its advantages in large-scale sparse problems.
翻译:可微分优化已引起广泛的研究关注,尤其在二次规划领域。现有方法通常依赖特定的集成求解器来实现QP解相对于其定义参数的微分,这种集成限制了其应用范围,包括在神经网络架构和双层优化任务中的使用,并将用户局限于有限的求解器选择。为克服这一局限,我们提出了dQP,一个模块化且与求解器无关的即插即用框架,可对几乎任何QP求解器进行微分。实现模块化的关键见解在于:一旦不等式约束的活跃集已知,解及其导数均可通过共享同一矩阵的简化线性系统表示。该公式将QP解的求解过程与其微分计算完全解耦。基于此结果,我们提供了一个开销极小的开源实现(https://github.com/cwmagoon/dQP),可无缝集成超过15种前沿求解器。全面的基准实验证明了dQP的鲁棒性和可扩展性,尤其凸显了其在大规模稀疏问题中的优势。