[iOS] Split the image processor into its own SwiftPM product instead of bundling it in executorch
Maintainer thường phản hồi trong vòng 1 ngày
@metascroy đang làm issue này rồi.
Từ ngày 11/9/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Problem
The image processor is bundled into the executorch xcframework, so the core runtime
product ends up carrying that helper's Apple framework dependencies.
scripts/build_apple_frameworks.sh merges nine static libraries into a single
executorch.xcframework, and libextension_image.a is one of them. Because it is merged,
a SwiftPM manifest cannot attach anything to that part alone: the smallest thing it can
describe is the whole product. So the frameworks the image processor needs have to be
declared on executorch itself.
That is what #22711 does, and it is the only place the current packaging allows. It reads,
though, as if the ExecuTorch runtime depends on Accelerate and Core Image, which it does
not. Every one of those symbols comes from the image processor:
image_processor_apple.o 8 undefined symbols (vImage, from Accelerate)
image_processor_apple_gpu.o 8 undefined symbols (Core Image)
No other object file in the shipped library references either framework.
There is also a size argument. The image processor is about 93 KB of a 967 KB library, so
roughly 10 percent, and every app that only wants Module and Tensor links it anyway.
Proposal
Give the image processor its own product, the way executorch_llm and executorch_dump
already work. Both build a separate xcframework and layer on the runtime rather than being
merged into it:
"executorch_llm": [
"targets": ["executorch"],
],
An executorch_image product would follow that shape and own its dependencies:
"executorch_image": [
"frameworks": ["Accelerate", "CoreGraphics", "CoreImage", "CoreVideo", "Foundation"],
"targets": ["executorch"],
],
executorch then goes back to declaring only c++, and apps that do not process images
stop linking the helper at all.
What it involves
- Build a separate
executorch_image.xcframeworkinscripts/build_apple_frameworks.sh,
holdinglibextension_image.a. - Add the product above to
Package.swift, and remove the framework block from
executorch. The same change is needed inPackage.swift.templateon theswiftpm
branch, which is what prebuilt users actually get. - Move the bindings,
ExecuTorchImageProcessor.h/.mmand
ExecuTorch+ImageProcessor.swift, out ofextension/appleinto the new product, and
drop#import "ExecuTorchImageProcessor.h"from theExecuTorch.humbrella header.
Step 3 is a breaking change. Today import ExecuTorch gives you the image processor. After
the split it needs a second import, so anyone using it since the bindings landed has to add
a line. Worth calling out in release notes.
Nothing in the runtime depends on extension_image; the only reference is the extension
list in the top-level CMakeLists.txt. So there is no dependency to untangle beyond the
bindings.
Test plan
swift package --disable-sandbox dump-packageshowsexecutorchwith onlyc++, and
executorch_imagewith the five frameworks.- Build a consumer that depends on
executorchalone and does not use the image processor,
and confirm it links with no Apple frameworks declared. - Build a consumer that depends on
executorch_imageand uses the image processor, and
confirm it links and runs on macOS, iOS device and the iOS simulator. - Run the iOS framework and demo app CI.
cc @shoumikhin @larryliu0820 @GregoryComer @cbilgin
- Ngôn ngữ chính
- Python
- Star
- 5k
- Fork
- 1.2k
- Merge trung bình
- 2 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 555
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pytorch/executorch
-
enhancement triaged
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 68/100
pytorch/executorch#21640 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement module: examples
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
pytorch/executorch#23164 · 7 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Qualcomm: 8-bit per-channel weight scales are floored at the 16-bit eps, and the HTP miscomputes near-zero channelsCó thể đã có người làm @psiddh đã nhận 1 ngày trước. Đang mởmodule: qnn partner: qualcomm
pytorch/executorch#23160 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[cpu kernels] native_layer_norm: layer_norm_scalar returns NaN on large-mean rows; Half/BF16 at N>=256 slow after #23153Có thể đã có người làm @JakeStevens đã nhận 1 ngày trước. Đang mởmodule: kernels
pytorch/executorch#23159 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
module: vulkan
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/100
pytorch/executorch#23158 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của pytorch/executorch
Issue tương tự
-
needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
openvinotoolkit/openvino_notebooks#3665 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
benchmark-gap
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày