Abstract
Sequential Least Squares Quadratic Programming (SLSQP) is a fundamental algorithm for solving non-linear programming (NLP) problems in engineering and physics. However, its performance is often limited by the QR factorization sub-routine. This paper introduces a parallel task-scheduling framework utilizing a dual-queue, lock-free Directed Acyclic Task Graph (DATG) approach. By decomposing QR factorization into fine-grained tasks and managing dependencies asynchronously, the framework achieves a 10x speedup over sequential implementations, effectively eliminating synchronization bottlenecks and enabling high-performance optimization for large-scale problems.
Introduction
Sequential Least Squares Quadratic Programming (SLSQP) is widely used for optimizing complex systems, such as aircraft wing shapes or molecular interactions. A critical component of SLSQP is QR factorization, which decomposes a matrix into an orthogonal matrix ($Q$) and an upper triangular matrix ($R$). Traditional parallel implementations of QR factorization often struggle within the SLSQP context for two reasons:
- Dependency Constraints: SLSQP requires access to intermediate factorization results, which "black-box" parallel libraries often do not provide.
- Parallel Inefficiency: Conventional methods rely on synchronization barriers, where processors must wait for the slowest thread to complete a stage. This leads to significant idle time and poor scalability on modern multi-core systems.
Methodology: Asynchronous Task Scheduling
To overcome these challenges, the authors propose an asynchronous scheduling model based on a Directed Acyclic Task Graph (DATG).
Task Decomposition and Graph Mapping
The QR factorization process is broken down into "micro-tasks," specifically pivot updates and trailing row updates. These tasks are mapped onto a DATG, where edges define the necessary execution order based on data dependencies.
Dual-Queue Execution
The core of the scheduling logic is a dual-queue system designed to minimize lock contention:
- Main Queue: Contains tasks whose dependencies have been fully satisfied and are ready for immediate execution by available threads.
- Wait Queue: Holds tasks that are still waiting for parent dependencies to complete.
As shown in the flowchart above, the Executor dequeues tasks from the Main Queue. Upon completion, it checks if the task has children. If so, it evaluates whether their dependencies are satisfied. Satisfied tasks move to the Main Queue; otherwise, they are placed in the Wait Queue.
Optimization Strategies
- Priority-Based Execution: Tasks on the "critical path"—the longest sequence of dependent tasks—are prioritized to unlock subsequent parallel work as quickly as possible.
- Workload Coalescing: To manage the overhead of the task graph, the authors introduced tuning parameters $\alpha$ and $\beta$. These parameters allow the system to group small row updates into larger "chunks," balancing the benefits of parallelism against the costs of task management.
Experimental Evaluation
The framework was evaluated using two primary datasets:
- Synthetic Benchmarks: Dense square matrices (from $300 \times 300$ to $10,800 \times 10,800$) were used to measure throughput and scalability.
- Real-World Engineering Data: Large-scale boundary value problems in structural engineering, specifically viscoelastic constitutive relations, with degrees of freedom (DOF) ranging from 640 to 2,816.
Key Insights
- Eliminating Barriers: Moving from a barrier-based model to an asynchronous queue-based model significantly increases CPU utilization by allowing threads to work on independent tasks without waiting for a global sync point.
- Granularity Control: The study highlights a "sweet spot" for task size. Over-parallelization leads to excessive management overhead, while under-parallelization leaves cores idle. The $\alpha$ and $\beta$ parameters are critical for finding this balance.
- In-Place Computation: To satisfy SLSQP's requirement for intermediate reflectors, the implementation performs "in-place" factorization, ensuring data integrity for subsequent back-substitution steps.
Results and Performance
The proposed parallel QR implementation demonstrated a 10x performance improvement over the sequential version found in standard libraries like NLOPT. In a structural engineering simulation with 2,816 DOF, the sequential execution time of 18.91 hours was reduced to just 1.21 hours. Furthermore, the system exhibited strong scalability, outperforming traditional barrier-based parallel execution models on up to 104 threads.
Conclusion and Future Work
While the dual-queue DATG approach provides substantial gains, the authors identified several areas for further improvement. Future work includes developing mathematical models for automatic parameter tuning ($\alpha, \beta$), transitioning to a "tiled" QR implementation for better memory locality, and implementing NUMA-aware scheduling to minimize data transfer delays across CPU sockets.
Summary updated