SIGN IN SIGN UP

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>
M
Mateusz Sluszniak committed
43cb2b2fbb99caf36d77a897d0506217fc8c1940
Parent: 6898c99
Committed by GitHub <noreply@github.com> on 7/30/2026, 11:34:08 PM