Skip to content

Export an MLX model for the iOS demo build - #22297

Open
shoumikhin wants to merge 1 commit into
mainfrom
ios-ci-mlx-export
Open

Export an MLX model for the iOS demo build#22297
shoumikhin wants to merge 1 commit into
mainfrom
ios-ci-mlx-export

Conversation

@shoumikhin

Copy link
Copy Markdown
Contributor

The mv3 Apple demo is gaining an MLX option (meta-pytorch/executorch-examples#260), and its Xcode project bundles mv3_mlx.pte. This job stages the demo's models with its own export commands, currently portable, Core ML and XNNPACK only, so without this the iOS build fails on a missing bundle resource.

MLX has no examples/ export script of its own yet, so the model is lowered inline, the same shape as the three exports already in this script.

Why this runs on the existing runner

Lowering is ahead of time. Neither backends/mlx/partitioner.py nor backends/mlx/preprocess.py imports the mlx runtime package:

grep -cE "^import mlx|^from mlx" backends/mlx/partitioner.py  -> 0
grep -cE "^import mlx|^from mlx\." backends/mlx/preprocess.py -> 0

So no new dependency and no Metal toolchain requirement at export time.

Checked

Every API and import target used here exists on main: MODEL_NAME_TO_MODEL (with mv3 as a key), EagerModelFactory.create_model returning the four-tuple this unpacks, to_edge_transform_and_lower, save_pte_program, and MLXPartitioner from executorch.backends.mlx. The output name mv3_mlx.pte matches what the demo's project bundles and what its own export.py writes.

bash -n on the script passes, and the heredoc body parses as Python.

The mv3 demo app is gaining an MLX option, and its Xcode project bundles
mv3_mlx.pte, so this job has to produce that file or the build fails on a missing
resource. MLX has no examples/ export script of its own yet, so lower it inline
the same way the script already drives the portable, Core ML and XNNPACK exports.

Lowering is ahead of time: neither the partitioner nor the preprocess step imports
the mlx runtime package, so this runs on the existing runner without new
dependencies.
Copilot AI lite review requested due to automatic review settings August 29, 2026 04:45
@pytorch-bot

pytorch-bot Bot commented Aug 29, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22297

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit c6f3e0d with merge base 9b558d9 (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants