Export an MLX model for the iOS demo build - #22297
Conversation
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.
🔗 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 ( 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. |
This PR needs a
|
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.pynorbackends/mlx/preprocess.pyimports themlxruntime package: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(withmv3as a key),EagerModelFactory.create_modelreturning the four-tuple this unpacks,to_edge_transform_and_lower,save_pte_program, andMLXPartitionerfromexecutorch.backends.mlx. The output namemv3_mlx.ptematches what the demo's project bundles and what its ownexport.pywrites.bash -non the script passes, and the heredoc body parses as Python.