macOS Python wheel _portable_lib has non-relocatable libtorch rpath
Maintainer antworten meist innerhalb von 1 Tag
@JacobSzwejbka arbeitet bereits daran.
Seit 14.10.2026.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Summary
The macOS ExecuTorch nightly wheel installs executorch.extension.pybindings._portable_lib, but its Mach-O rpath points at a CI-only Torch directory. On a normal virtual environment, importing the module fails because @rpath/libtorch_python.dylib cannot be resolved.
It can be worked around with
DYLD_FALLBACK_LIBRARY_PATH="$VIRTUAL_ENV/lib/python3.13/site-packages/torch/lib${DYLD_FALLBACK_LIBRARY_PATH:+:$DYLD_FALLBACK_LIBRARY_PATH}" python -c 'import
│ executorch.extension.pybindings._portable_lib; print("portable pybind runtime loaded")'
Environment
- macOS
- Python 3.13.3
executorch==1.4.0.dev20260818torch==2.13.0
Reproduction
python -c "import executorch.extension.pybindings._portable_lib"
The import fails with:
dlopen(.../_portable_lib.cpython-313-darwin.so, 0x0002): Library not loaded: @rpath/libtorch_python.dylib
Reason: tried: '/Users/runner/work/_temp/conda_environment_32133036333/lib/python3.13/site-packages/torch/lib/libtorch_python.dylib' (no such file),
Evidence
otool -L venv/lib/python3.13/site-packages/executorch/extension/pybindings/_portable_lib.cpython-313-darwin.so
otool -l venv/lib/python3.13/site-packages/executorch/extension/pybindings/_portable_lib.cpython-313-darwin.so
The extension links against:
@rpath/libtorch_python.dylib
@rpath/libtorch.dylib
@rpath/libtorch_cpu.dylib
@rpath/libc10.dylib
but contains only this rpath:
Load command 25
cmd LC_RPATH
cmdsize 112
path /Users/runner/work/_temp/conda_environment_32133036333/lib/python3.13/site-packages/torch/lib (offset 12)
That build-machine path does not exist for wheel users.
Expected behavior
The wheel should be relocatable: _portable_lib should locate the libtorch*.dylib files supplied by the installed Torch wheel, for example via an appropriate relative @loader_path/@rpath installation layout or a repaired wheel rpath.
Actual behavior
The native runtime cannot load, so downstream packages cannot register native backends against it. The failure can be easy to miss when callers catch OSError to keep their Python package importable; backend availability then fails later at model load.
- Vorherrschende Sprache
- Python
- Sterne
- 5.1k
- Forks
- 1.2k
- Ø Merge
- 2 T. 14 Min.
- Gemergte PRs (30 T.)
- 704
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus pytorch/executorch
-
Portable remainder kernel: wrong sign for integers and float64 rounded to floatEvtl. vergeben @JakeStevens hat das vor 4 Tagen übernommen. Offenbug module: kernels triaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
pytorch/executorch#23682 · 2 zugewiesene Personen ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement triaged
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 68/100
pytorch/executorch#21640 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[QNN] 16a4w_block stride-2 conv + ReLU fails HTP graph prepare on SM8850 (Relu16bParamsPlaceholder)Evtl. vergeben @psiddh hat das heute übernommen. Offenbug module: qnn partner: qualcomm
pytorch/executorch#23922 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 40/100
pytorch/executorch#23913 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug module: microcontrollers partner: arm
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 38/100
pytorch/executorch#23812 · 2 Kommentare · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in pytorch/executorch
Ähnliche Issues
-
bot-triaged module: LrScheduler module: optimizer triaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 1 Tag
-
documentation glm5 llm-model
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
vllm-project/vllm-ascend#19062 ·
Maintainer antworten meist innerhalb von 1 Tag
-
author-page correction
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
acl-org/acl-anthology#10496 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Issue Type: Bug Report
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
celery/celery#10875 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
SasanLabs/VulnerableApp#836 ·
Maintainer antworten meist innerhalb von 1 Tag