Skip to content

Commit 7f1ecfb

Browse files
shoumikhinfacebook-github-bot
authored andcommitted
Build option for quantized backend framework. (#2617)
Summary: bypass-github-export-checks Reviewed By: kirklandsign Differential Revision: D55263807
1 parent e1e381b commit 7f1ecfb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

build/build_apple_frameworks.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ IOS_DEPLOYMENT_TARGET="17.0"
2020
COREML=OFF
2121
MPS=OFF
2222
PORTABLE=OFF
23+
QUANTIZED=OFF
2324
XNNPACK=OFF
2425
HEADERS_PATH="include"
2526
EXECUTORCH_FRAMEWORK="executorch:libexecutorch.a,libextension_apple.a,libextension_data_loader.a,libextension_module.a:$HEADERS_PATH"
2627
COREML_FRAMEWORK="coreml_backend:libcoremldelegate.a:"
2728
MPS_FRAMEWORK="mps_backend:libmpsdelegate.a:"
2829
PORTABLE_FRAMEWORK="portable_backend:libportable_kernels.a,libportable_ops_lib.a:"
30+
QUANTIZED_FRAMEWORK="quantized_backend:libquantized_kernels.a,libquantized_ops_lib.a:"
2931
XNNPACK_FRAMEWORK="xnnpack_backend:libXNNPACK.a,libcpuinfo.a,libpthreadpool.a,libxnnpack_backend.a:"
3032

3133
usage() {
@@ -43,6 +45,7 @@ usage() {
4345
echo " --coreml Include this flag to build the Core ML backend."
4446
echo " --mps Include this flag to build the Metal Performance Shaders backend."
4547
echo " --portable Include this flag to build the Portable backend."
48+
echo " --quantized Include this flag to build the Quantized backend."
4649
echo " --xnnpack Include this flag to build the XNNPACK backend."
4750
echo
4851
echo "Example:"
@@ -61,8 +64,9 @@ for arg in "$@"; do
6164
--flatc=*) FLATC="${arg#*=}" ;;
6265
--ios-deployment-target=*) IOS_DEPLOYMENT_TARGET="${arg#*=}" ;;
6366
--coreml) COREML=ON ;;
64-
--portable) PORTABLE=ON ;;
6567
--mps) MPS=ON ;;
68+
--portable) PORTABLE=ON ;;
69+
--quantized) QUANTIZED=ON ;;
6670
--xnnpack) XNNPACK=ON ;;
6771
*)
6872
if [[ -z "$SOURCE_ROOT_DIR" ]]; then
@@ -122,6 +126,7 @@ cmake_build() {
122126
-DIOS_DEPLOYMENT_TARGET="$IOS_DEPLOYMENT_TARGET" \
123127
-DEXECUTORCH_BUILD_COREML=$COREML \
124128
-DEXECUTORCH_BUILD_MPS=$MPS \
129+
-DREGISTER_QUANTIZED_OPS=$QUANTIZED \
125130
-DEXECUTORCH_BUILD_XNNPACK=$XNNPACK \
126131
${platform_flag:+-DIOS_PLATFORM=$platform_flag}
127132
cmake --build . --config $MODE
@@ -159,9 +164,10 @@ append_framework_flag() {
159164
}
160165

161166
append_framework_flag "ON" "$EXECUTORCH_FRAMEWORK"
162-
append_framework_flag "$PORTABLE" "$PORTABLE_FRAMEWORK"
163167
append_framework_flag "$COREML" "$COREML_FRAMEWORK"
164168
append_framework_flag "$MPS" "$MPS_FRAMEWORK"
169+
append_framework_flag "$PORTABLE" "$PORTABLE_FRAMEWORK"
170+
append_framework_flag "$QUANTIZED" "$QUANTIZED_FRAMEWORK"
165171
append_framework_flag "$XNNPACK" "$XNNPACK_FRAMEWORK"
166172

167173
"$SOURCE_ROOT_DIR"/build/create_frameworks.sh "${FRAMEWORK_FLAGS[@]}"

0 commit comments

Comments
 (0)