Skip to content

Add a CPU Moreau backend for MLX - #249

Draft
PTNobel wants to merge 1 commit into
ptn/moreau-defaultfrom
ptn/moreau-mlx
Draft

PTNobel wants to merge 1 commit into
ptn/moreau-defaultfrom
ptn/moreau-mlx

Conversation

@PTNobel

@PTNobel PTNobel commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

ChatGPT generated:

Add an explicit solver=cp.MOREAU backend for MLX using Moreau's CPU solver. The adapter supports batching and custom VJPs for primal and dual outputs, including direct cones, PSD coordinate scaling, and vectorized cone-dual recovery. MLX keeps DIFFCP as its default.

This is the second PR in the Moreau stack, based on #248 (ptn/moreau-default), and contains only the MLX adapter, its documentation, and its regression tests. It uses CPU solves even when MLX arrays live on a Metal device; native Metal execution is outside this change.

All 58 MLX tests pass against companion Moreau stack tip 4b1b73627fff8ceaec002198b3ada080ebc28537. The adapter files pass pre-commit, including Pyright. The MLX-specific diff is unchanged by the rebase onto #248's compilation fixes. This remains a draft alongside the foundation until the required Moreau changes, including moreau-project/moreau#13 and moreau-project/moreau#22, are available to package-based CI.

@PTNobel
PTNobel added this pull request to stack #250 September 16, 2026 08:12
@PTNobel PTNobel changed the title ChatGPT generated: Add a CPU Moreau backend for MLX Add a CPU Moreau backend for MLX Sep 16, 2026

@SteveDiamond SteveDiamond left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CPU-only MLX adapter and its per-forward solver state/VJP handling look reasonable, with useful primal/dual, batching, PSD, and repeated-call coverage. Approving the implementation as a stacked draft. Its historical CI failures predate the latest #248 updates; rebase onto that foundation and rerun with the packaged native fixes before merging. I did not run MLX tests locally.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants