Skip to content

Development Plan

  1. Add support for differentiation along the dual variables in SolMapLayer.

    • Allow each constraint to be named.
    • Return dual variables in a dictionary, for example, {"eq_cons": dual_eq, "ineq_cons": dual_ineq}.
  2. Further refine portable parallel execution.

    • The cross-platform compatibility path is implemented: Linux retains the tested fork behavior, while Windows and macOS use shared-memory threads for solution-map backward workers without requiring an entry-point guard.
    • Forced-thread tests cover full- and reduced-KKT gradients and standalone script execution without an if __name__ == "__main__": guard.
    • A future cleanup can remove the unused Linux backward process pool from ValueFuncLayer and expose an optional multiprocessing-context setting.
  3. Use the CvxpyLayers forward and backward parallel settings for DiffAPQP.

    • DiffAPQP limits nested BLAS/OpenMP execution to one native thread per backward worker. DiffCP applies this limit to its parallel forward pass but does not currently apply the same explicit limit to its backward thread pool.
    • DiffAPQP also retains a fork-based backward process pool on Linux, while using threads on macOS and Windows; DiffCP uses threads on all three platforms.
    • DiffAPQP creates persistent worker pools and reuses them across calls, while DiffCP creates and closes a thread pool for each forward or backward call.
    • DiffAPQP uses one max_n_cores setting for both passes, whereas DiffCP supports separate n_jobs_forward and n_jobs_backward settings.