Repository navigation
Commit 2b3a32d
Export an MLX model for the iOS demo build (pytorch#22297)
## Problem
The mv3 demo app is gaining an MLX option. Its Xcode project will bundle
`mv3_mlx.pte`, so the iOS CI job that stages models for the demo has to
produce
that file, or the build fails on a missing resource.
## Change
Lower the model to MLX inline, the same way the script already drives
the
portable, Core ML and XNNPACK exports (there is no generic `examples/`
entry
point that takes a model name and lowers it to MLX). The same export is
added to
both iOS scripts.
The check reads the delegates directly off the program and fails unless
the model
produced an MLX delegate. The MLX partitioner only logs a warning when
it
delegates nothing and still returns a valid program, so without this a
model with
no MLX delegate would be staged under an MLX name and the demo would
still pass on
the portable kernels. The check runs before the file is written.
## Landing order
This change must land first. It produces `mv3_mlx.pte`; the demo change
consumes
it. The scripts clone the demo's default branch, so if the demo landed
first its
project would require a model this script does not yet produce and the
iOS build
would break.
## Test Plan
Ran the lowering and the delegate check against a delegated model: the
count is 1
and the file is written; a non-delegated program gives 0 and the check
fails
before writing anything. Runtime execution of the staged model is not
exercised
here; delegate presence is.
Co-authored-by: PyTorch Bot <pytorchbot@users.noreply.github.com>1 parent beb5b16 commit 2b3a32d
2 files changed
Lines changed: 74 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
52 | 89 | | |
53 | 90 | | |
54 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
69 | 106 | | |
70 | 107 | | |
71 | 108 | | |
| |||
0 commit comments