Commit 43cb2b2
fix(mlx): forward boundary-partitioned getitem instead of indexing a Slot (#21441)
## Summary
The MLX partitioner can place an `operator.getitem` inside a partition
while leaving its multi-output parent (e.g. `aten.native_layer_norm`)
outside it. In that case `_getitem_handler` receives the
already-selected element as a single boundary-input `Slot` rather than
the source tuple, so `a[idx]` raises `'Slot' object is not
subscriptable` and aborts the export.
This fix forwards the `Slot` directly when the resolved arg isn't a
tuple/list — the partitioner has already fed the selected element as the
partition input.
## Impact
Unblocks transformer / layer-norm-heavy models (e.g. RF-DETR) through
the MLX delegate. Localized, one-file change to the op handler; no
schema/serialization change.
## Test plan
- Verified that DETR-style exports (dozens of `native_layer_norm` ops)
lower and run correctly on device through the MLX delegate with this
change.
- Non-boundary getitem (source is a tuple/list of slots) is unchanged:
`a[idx]` still selects the element.
cc @metascroy
Co-authored-by: Scott Roy <161522778+metascroy@users.noreply.github.com>1 parent 6898c99 commit 43cb2b2
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2272 | 2272 | | |
2273 | 2273 | | |
2274 | 2274 | | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
2275 | 2279 | | |
2276 | 2280 | | |
2277 | | - | |
| 2281 | + | |
2278 | 2282 | | |
2279 | 2283 | | |
2280 | 2284 | | |
| |||
0 commit comments