Skip to content

Commit c0ad8ac

Browse files
committed
Update
[ghstack-poisoned]
2 parents 5a0da3f + b721485 commit c0ad8ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+696
-418
lines changed

.ci/scripts/wheel/test_linux.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
test_base.ModelTest(
1515
model=Model.Mv3,
1616
backend=Backend.XnnpackQuantizationDelegation,
17-
)
17+
),
18+
test_base.ModelTest(
19+
model=Model.Mv3,
20+
backend=Backend.CoreMlExportOnly,
21+
),
1822
]
1923
)

.ci/scripts/wheel/test_macos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
),
1818
test_base.ModelTest(
1919
model=Model.Mv3,
20-
backend=Backend.CoreMlTest,
20+
backend=Backend.CoreMlExportAndTest,
2121
),
2222
]
2323
)

.github/workflows/apple.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ jobs:
156156
"kernels_optimized"
157157
"kernels_portable"
158158
"kernels_quantized"
159+
"threadpool"
159160
)
160161
161162
.ci/scripts/setup-conda.sh

.lintrunner.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,6 @@ exclude_patterns = [
390390
"third-party/**",
391391
# TODO: remove exceptions as we migrate
392392
# backends
393-
"backends/arm/quantizer/**",
394-
"backends/arm/test/ops/**",
395393
"backends/vulkan/quantizer/**",
396394
"backends/vulkan/test/**",
397395
"backends/qualcomm/quantizer/**",

CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,6 @@ if(EXECUTORCH_BUILD_PTHREADPOOL AND EXECUTORCH_BUILD_CPUINFO)
565565
endif()
566566

567567
if(EXECUTORCH_BUILD_PYBIND)
568-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third-party/pybind11)
569-
570568
if(NOT EXECUTORCH_BUILD_EXTENSION_DATA_LOADER)
571569
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/data_loader)
572570
endif()
@@ -602,7 +600,7 @@ if(EXECUTORCH_BUILD_PYBIND)
602600
list(APPEND _dep_libs portable_ops_lib)
603601
endif()
604602

605-
if(EXECUTORCH_BUILD_COREML)
603+
if(EXECUTORCH_BUILD_COREML AND APPLE)
606604
list(APPEND _dep_libs coremldelegate)
607605
endif()
608606

@@ -701,7 +699,7 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
701699
list(APPEND _executor_runner_libs etdump flatccrt)
702700
endif()
703701

704-
if(EXECUTORCH_BUILD_COREML)
702+
if(EXECUTORCH_BUILD_COREML AND APPLE)
705703
list(APPEND _executor_runner_libs coremldelegate)
706704
endif()
707705

Package.swift

Lines changed: 45 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919

2020
import PackageDescription
2121

22-
let debug = "_debug"
23-
let deliverables = [
22+
let debug_suffix = "_debug"
23+
let dependencies_suffix = "_with_dependencies"
24+
25+
let products = [
2426
"backend_coreml": [
2527
"frameworks": [
2628
"Accelerate",
@@ -37,49 +39,64 @@ let deliverables = [
3739
"MetalPerformanceShadersGraph",
3840
],
3941
],
40-
"backend_xnnpack": [:],
41-
"executorch": [:],
42+
"backend_xnnpack": [
43+
"targets": [
44+
"threadpool",
45+
],
46+
],
47+
"executorch": [
48+
"libraries": [
49+
"c++",
50+
],
51+
],
4252
"kernels_custom": [:],
43-
"kernels_optimized": [:],
53+
"kernels_optimized": [
54+
"frameworks": [
55+
"Accelerate",
56+
],
57+
"targets": [
58+
"threadpool",
59+
],
60+
],
4461
"kernels_portable": [:],
4562
"kernels_quantized": [:],
4663
].reduce(into: [String: [String: Any]]()) {
4764
$0[$1.key] = $1.value
48-
$0[$1.key + debug] = $1.value
49-
}.reduce(into: [String: [String: Any]]()) {
50-
var newValue = $1.value
51-
if $1.key.hasSuffix(debug) {
52-
$1.value.forEach { key, value in
53-
if key.hasSuffix(debug) {
54-
newValue[String(key.dropLast(debug.count))] = value
55-
}
56-
}
57-
}
58-
$0[$1.key] = newValue.filter { key, _ in !key.hasSuffix(debug) }
65+
$0[$1.key + debug_suffix] = $1.value
5966
}
6067

68+
let targets = [
69+
"threadpool",
70+
].flatMap { [$0, $0 + debug_suffix] }
71+
6172
let package = Package(
6273
name: "executorch",
6374
platforms: [
6475
.iOS(.v17),
6576
.macOS(.v10_15),
6677
],
67-
products: deliverables.keys.map { key in
68-
.library(name: key, targets: ["\(key)_dependencies"])
78+
products: products.keys.map { key in
79+
.library(name: key, targets: ["\(key)\(dependencies_suffix)"])
6980
}.sorted { $0.name < $1.name },
70-
targets: deliverables.flatMap { key, value -> [Target] in
81+
targets: targets.map { key in
82+
.binaryTarget(
83+
name: key,
84+
path: "cmake-out/\(key).xcframework"
85+
)
86+
} + products.flatMap { key, value -> [Target] in
7187
[
7288
.binaryTarget(
7389
name: key,
7490
path: "cmake-out/\(key).xcframework"
7591
),
7692
.target(
77-
name: "\(key)_dependencies",
78-
dependencies: [.target(name: key)],
93+
name: "\(key)\(dependencies_suffix)",
94+
dependencies:([key] +
95+
(value["targets"] as? [String] ?? []).map {
96+
target in key.hasSuffix(debug_suffix) ? target + debug_suffix : target
97+
}).map { .target(name: $0) },
7998
path: ".Package.swift/\(key)",
80-
linkerSettings: [
81-
.linkedLibrary("c++")
82-
] +
99+
linkerSettings:
83100
(value["frameworks"] as? [String] ?? []).map { .linkedFramework($0) } +
84101
(value["libraries"] as? [String] ?? []).map { .linkedLibrary($0) }
85102
),
@@ -88,18 +105,17 @@ let package = Package(
88105
.testTarget(
89106
name: "tests",
90107
dependencies: [
91-
.target(name: "executorch_debug"),
92-
.target(name: "kernels_portable"),
108+
.target(name: "executorch\(debug_suffix)"),
109+
.target(name: "kernels_optimized\(dependencies_suffix)"),
93110
],
94111
path: "extension/apple/ExecuTorch/__tests__",
95112
resources: [
96-
.copy("resources/add.pte")
113+
.copy("resources/add.pte"),
97114
],
98115
linkerSettings: [
99-
.linkedLibrary("c++"),
100116
.unsafeFlags([
101117
"-Xlinker", "-force_load",
102-
"-Xlinker", "cmake-out/kernels_portable.xcframework/macos-arm64/libkernels_portable_macos.a",
118+
"-Xlinker", "cmake-out/kernels_optimized.xcframework/macos-arm64/libkernels_optimized_macos.a",
103119
])
104120
]
105121
)

0 commit comments

Comments
 (0)