macOS Python wheel _portable_lib has non-relocatable libtorch rpath
维护者通常 1 天内回复
@JacobSzwejbka 已经在做这个了。
开始于 2026年10月14日。
评估
这个 Issue 还没有评估数据。
描述
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.
- 主要语言
- Python
- 星标
- 5.1k
- 派生
- 1.2k
- 平均合并
- 2 天 51 分钟
- 30 天内合并 PR
- 712
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pytorch/executorch 的其他 Issue
-
Portable remainder kernel: wrong sign for integers and float64 rounded to float可能已有人在做 @JakeStevens 于 3 天前认领。 未关闭bug module: kernels triaged
难度 2/5 1-3 小时 新手友好度 82/100
pytorch/executorch#23682 · 已指派 2 人 ·
维护者通常 1 天内回复
-
enhancement triaged
难度 2/5 半天 新手友好度 68/100
pytorch/executorch#21640 ·
维护者通常 1 天内回复
-
bug module: microcontrollers partner: arm
难度 4/5 3-5 天 新手友好度 38/100
pytorch/executorch#23812 · 1 个 reaction ·
维护者通常 1 天内回复
-
[muse-glimmer] interpolate_pos_emb returns corrupted bf16 values on CPU and can segfault可能已有人在做 @JakeStevens 于 1 天前认领。 未关闭bug module: examples triaged
pytorch/executorch#23797 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
invalid module: doc
难度 3/5 1-2 天 新手友好度 35/100
pytorch/executorch#23706 · 1 条评论 ·
维护者通常 1 天内回复
查看 pytorch/executorch 的全部 Issue
相似的 Issue
-
Path subtraction removes repeated suffix characters instead of one suffix可能已有人在做 @Gwerdonatus 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
joke2k/django-environ#671 ·
-
good first issue help wanted windows
难度 2/5 1-3 小时 新手友好度 80/100
-
test_pgbouncer deploys the server under test from Charmhub instead of the local build (track/1.31)未关闭bug
难度 2/5 1-3 小时 新手友好度 68/100
canonical/temporal-k8s-operator#195 · 1 条评论 ·
维护者通常 4 天内回复
-
`burr` fails to start when the Python path has a space in it可能已有人在做 @enekoreto 今天认领。 未关闭status/needs-triage
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 5 天内回复
-
device support request
难度 2/5 1-3 小时 新手友好度 68/100
zigpy/zha-device-handlers#5461 ·
维护者通常 4 天内回复