Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
03b306d
Rebase
hinriksnaer Jun 19, 2025
b4dd92b
Updated CMakeLists for torchao
hinriksnaer May 19, 2025
b6e0518
Fixed parameter name
hinriksnaer May 19, 2025
e0e6e98
added missing flag
hinriksnaer May 19, 2025
f575cbf
updated build steps
hinriksnaer May 20, 2025
9b9aa90
up
metascroy May 21, 2025
9e913c4
Work In Progress: changes to build_apple_framework.sh
hinriksnaer May 27, 2025
c16c779
cleaned up the cmake command
hinriksnaer May 27, 2025
c0c26aa
updated cmake and framework build
hinriksnaer May 29, 2025
70c6ae6
up
metascroy May 30, 2025
21bb1c1
added torchao debug xcconfig
hinriksnaer Jun 18, 2025
82659ec
added temporary build scripts
hinriksnaer Jun 18, 2025
402a7ed
aligned submodules
hinriksnaer Jun 19, 2025
e1f9b8a
fixed accidental changes from rebase
hinriksnaer Jun 19, 2025
3b11e4c
added missing torchao param
hinriksnaer Jun 19, 2025
06c2583
Rebase
hinriksnaer Jun 19, 2025
a8f3b35
removed accidental code inclusion due to rebase
hinriksnaer Jun 26, 2025
ed0ccd3
updated apple framework defaults
hinriksnaer Jun 28, 2025
6eebd8d
updated torchao debug
hinriksnaer Jun 28, 2025
8f80fde
updated tokenizer module
hinriksnaer Jun 28, 2025
c146407
updated debug conf
hinriksnaer Jun 29, 2025
e1f0101
added export script
hinriksnaer Jun 29, 2025
5dd6df8
Update comments in CMakeLists.txt
hinriksnaer Jul 1, 2025
5200d68
updated rebase
hinriksnaer Jul 29, 2025
276232e
updated bash formatting
hinriksnaer Jul 28, 2025
58b24c2
Removed dev scripts
hinriksnaer Jul 28, 2025
6a00da3
reverted to existing changes
hinriksnaer Jul 29, 2025
435ffa1
removed dev script
hinriksnaer Jul 29, 2025
16b8984
fixed submodules
hinriksnaer Jul 29, 2025
3547232
Merge branch 'main' into torchao-build
hinriksnaer Jul 29, 2025
03f584a
updated link name
hinriksnaer Jul 29, 2025
eab0f73
changed dependency reference in torchao build
hinriksnaer Jul 30, 2025
935da89
Merge branch 'main' into torchao-build
hinriksnaer Jul 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,30 @@ if(EXECUTORCH_BUILD_PTHREADPOOL)
)
endif()

if(EXECUTORCH_BUILD_KERNELS_TORCHAO)
set(TORCHAO_BUILD_ATEN_OPS OFF)
set(TORCHAO_BUILD_EXECUTORCH_OPS ON)
set(TORCHAO_BUILD_CPU_AARCH64 ON)
set(TORCHAO_ENABLE_ARM_NEON_DOT ON)

list(APPEND TORCHAO_INCLUDE_DIRS
${EXECUTORCH_ROOT}/backends/xnnpack/third-party/pthreadpool/include
${EXECUTORCH_ROOT}/backends/xnnpack/third-party/cpuinfo/include
${EXECUTORCH_ROOT}/third-party/ao
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What adding "${EXECUTORCH_ROOT}/third-party/ao" necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing it caused the build process to fail.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the failure?

Copy link
Contributor Author

@hinriksnaer hinriksnaer Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the bottom of the terminal output

CompileC /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/quantize.o /Users/softmax/Documents/projects/executorch/third-party/ao/torchao/experimental/kernels/cpu/aarch64/quantization/quantize.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'torchao_kernels_aarch64' from project 'executorch')
    cd /Users/softmax/Documents/projects/executorch

    Using response file: /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/82b82416624d2658e5098eb0a28c15c5-common-args.resp

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -ivfsstatcache /var/folders/cq/9bb9rdrs2jvcv_9rk42bk3h80000gn/C/com.apple.DeveloperTools/16.3-16E140/Xcode/SDKStatCaches.noindex/iphoneos18.4-22E235-a09501eccf75f892bc376f81961b27ba.sdkstatcache -fmessage-length\=214 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fcolor-diagnostics -Wno-trigraphs -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -Wno-implicit-fallthrough -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -Wall -Werror -Wno-deprecated -Wno-shorten-64-to-32 @/Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/82b82416624d2658e5098eb0a28c15c5-common-args.resp -MMD -MT dependencies -MF /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/quantize.d --serialize-diagnostics /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/quantize.dia -c /Users/softmax/Documents/projects/executorch/third-party/ao/torchao/experimental/kernels/cpu/aarch64/quantization/quantize.cpp -o /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/quantize.o
/Users/softmax/Documents/projects/executorch/third-party/ao/torchao/experimental/kernels/cpu/aarch64/quantization/quantize.cpp:9:10: fatal error:
      'torchao/experimental/kernels/cpu/aarch64/quantization/quantize.h' file not found
    9 | #include <torchao/experimental/kernels/cpu/aarch64/quantization/quantize.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


CompileC /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/interleave.o /Users/softmax/Documents/projects/executorch/third-party/ao/torchao/experimental/kernels/cpu/aarch64/valpacking/interleave.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'torchao_kernels_aarch64' from project 'executorch')
    cd /Users/softmax/Documents/projects/executorch

    Using response file: /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/82b82416624d2658e5098eb0a28c15c5-common-args.resp

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -ivfsstatcache /var/folders/cq/9bb9rdrs2jvcv_9rk42bk3h80000gn/C/com.apple.DeveloperTools/16.3-16E140/Xcode/SDKStatCaches.noindex/iphoneos18.4-22E235-a09501eccf75f892bc376f81961b27ba.sdkstatcache -fmessage-length\=214 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fcolor-diagnostics -Wno-trigraphs -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -Wno-implicit-fallthrough -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -Wall -Werror -Wno-deprecated -Wno-shorten-64-to-32 @/Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/82b82416624d2658e5098eb0a28c15c5-common-args.resp -MMD -MT dependencies -MF /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/interleave.d --serialize-diagnostics /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/interleave.dia -c /Users/softmax/Documents/projects/executorch/third-party/ao/torchao/experimental/kernels/cpu/aarch64/valpacking/interleave.cpp -o /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/interleave.o
/Users/softmax/Documents/projects/executorch/third-party/ao/torchao/experimental/kernels/cpu/aarch64/valpacking/interleave.cpp:7:10: fatal error:
      'torchao/experimental/kernels/cpu/aarch64/valpacking/valpack.h' file not found
    7 | #include <torchao/experimental/kernels/cpu/aarch64/valpacking/valpack.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


CompileC /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/find_min_and_max.o /Users/softmax/Documents/projects/executorch/third-party/ao/torchao/experimental/kernels/cpu/aarch64/reduction/find_min_and_max.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'torchao_kernels_aarch64' from project 'executorch')
    cd /Users/softmax/Documents/projects/executorch

    Using response file: /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/82b82416624d2658e5098eb0a28c15c5-common-args.resp

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -ivfsstatcache /var/folders/cq/9bb9rdrs2jvcv_9rk42bk3h80000gn/C/com.apple.DeveloperTools/16.3-16E140/Xcode/SDKStatCaches.noindex/iphoneos18.4-22E235-a09501eccf75f892bc376f81961b27ba.sdkstatcache -fmessage-length\=214 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fcolor-diagnostics -Wno-trigraphs -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -Wno-implicit-fallthrough -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -Wall -Werror -Wno-deprecated -Wno-shorten-64-to-32 @/Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/82b82416624d2658e5098eb0a28c15c5-common-args.resp -MMD -MT dependencies -MF /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/find_min_and_max.d --serialize-diagnostics /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/find_min_and_max.dia -c /Users/softmax/Documents/projects/executorch/third-party/ao/torchao/experimental/kernels/cpu/aarch64/reduction/find_min_and_max.cpp -o /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/find_min_and_max.o
/Users/softmax/Documents/projects/executorch/third-party/ao/torchao/experimental/kernels/cpu/aarch64/reduction/find_min_and_max.cpp:9:10: fatal error:
      'torchao/experimental/kernels/cpu/aarch64/reduction/reduction.h' file not found
    9 | #include <torchao/experimental/kernels/cpu/aarch64/reduction/reduction.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Libtool /Users/softmax/Documents/projects/executorch/cmake-out/ios/Release/libabsl_utf8_for_code_point.a normal (in target 'utf8_for_code_point' from project 'executorch')
    cd /Users/softmax/Documents/projects/executorch
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only arm64 -D -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.4.sdk -L/Users/softmax/Documents/projects/executorch/cmake-out/ios/Release -filelist /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/utf8_for_code_point.build/Release-iphoneos/Objects-normal/arm64/absl_utf8_for_code_point.LinkFileList -dependency_info /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/utf8_for_code_point.build/Release-iphoneos/Objects-normal/arm64/absl_utf8_for_code_point_libtool_dependency_info.dat -o /Users/softmax/Documents/projects/executorch/cmake-out/ios/Release/libabsl_utf8_for_code_point.a

CompileC /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/compute_sum.o /Users/softmax/Documents/projects/executorch/third-party/ao/torchao/experimental/kernels/cpu/aarch64/reduction/compute_sum.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'torchao_kernels_aarch64' from project 'executorch')
    cd /Users/softmax/Documents/projects/executorch

    Using response file: /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/82b82416624d2658e5098eb0a28c15c5-common-args.resp

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -ivfsstatcache /var/folders/cq/9bb9rdrs2jvcv_9rk42bk3h80000gn/C/com.apple.DeveloperTools/16.3-16E140/Xcode/SDKStatCaches.noindex/iphoneos18.4-22E235-a09501eccf75f892bc376f81961b27ba.sdkstatcache -fmessage-length\=214 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fcolor-diagnostics -Wno-trigraphs -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -Wno-implicit-fallthrough -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -Wall -Werror -Wno-deprecated -Wno-shorten-64-to-32 @/Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/82b82416624d2658e5098eb0a28c15c5-common-args.resp -MMD -MT dependencies -MF /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/compute_sum.d --serialize-diagnostics /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/compute_sum.dia -c /Users/softmax/Documents/projects/executorch/third-party/ao/torchao/experimental/kernels/cpu/aarch64/reduction/compute_sum.cpp -o /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/compute_sum.o

CompileC /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/tokenizers.build/Release-iphoneos/Objects-normal/arm64/unicode.o /Users/softmax/Documents/projects/executorch/extension/llm/tokenizers/third-party/llama.cpp-unicode/src/unicode.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'tokenizers' from project 'executorch')
    cd /Users/softmax/Documents/projects/executorch

    Using response file: /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/tokenizers.build/Release-iphoneos/Objects-normal/arm64/82b82416624d2658e5098eb0a28c15c5-common-args.resp

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -ivfsstatcache /var/folders/cq/9bb9rdrs2jvcv_9rk42bk3h80000gn/C/com.apple.DeveloperTools/16.3-16E140/Xcode/SDKStatCaches.noindex/iphoneos18.4-22E235-a09501eccf75f892bc376f81961b27ba.sdkstatcache -fmessage-length\=214 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fcolor-diagnostics -Wno-trigraphs -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -Wno-implicit-fallthrough -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -Wno-attributes @/Users/softmax/Documents/projects/executorch/cmake-out/ios/build/tokenizers.build/Release-iphoneos/Objects-normal/arm64/82b82416624d2658e5098eb0a28c15c5-common-args.resp -MMD -MT dependencies -MF /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/tokenizers.build/Release-iphoneos/Objects-normal/arm64/unicode.d --serialize-diagnostics /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/tokenizers.build/Release-iphoneos/Objects-normal/arm64/unicode.dia -c /Users/softmax/Documents/projects/executorch/extension/llm/tokenizers/third-party/llama.cpp-unicode/src/unicode.cpp -o /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/tokenizers.build/Release-iphoneos/Objects-normal/arm64/unicode.o

CompileC /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/tokenizers.build/Release-iphoneos/Objects-normal/arm64/unicode-data.o /Users/softmax/Documents/projects/executorch/extension/llm/tokenizers/third-party/llama.cpp-unicode/src/unicode-data.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'tokenizers' from project 'executorch')
    cd /Users/softmax/Documents/projects/executorch

    Using response file: /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/tokenizers.build/Release-iphoneos/Objects-normal/arm64/82b82416624d2658e5098eb0a28c15c5-common-args.resp

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -ivfsstatcache /var/folders/cq/9bb9rdrs2jvcv_9rk42bk3h80000gn/C/com.apple.DeveloperTools/16.3-16E140/Xcode/SDKStatCaches.noindex/iphoneos18.4-22E235-a09501eccf75f892bc376f81961b27ba.sdkstatcache -fmessage-length\=214 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fcolor-diagnostics -Wno-trigraphs -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -Wno-implicit-fallthrough -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -Wno-attributes @/Users/softmax/Documents/projects/executorch/cmake-out/ios/build/tokenizers.build/Release-iphoneos/Objects-normal/arm64/82b82416624d2658e5098eb0a28c15c5-common-args.resp -MMD -MT dependencies -MF /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/tokenizers.build/Release-iphoneos/Objects-normal/arm64/unicode-data.d --serialize-diagnostics /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/tokenizers.build/Release-iphoneos/Objects-normal/arm64/unicode-data.dia -c /Users/softmax/Documents/projects/executorch/extension/llm/tokenizers/third-party/llama.cpp-unicode/src/unicode-data.cpp -o /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/tokenizers.build/Release-iphoneos/Objects-normal/arm64/unicode-data.o

note: Run script build phase 'Generate third-party/CMakeFiles/flatcc_external_project' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'flatcc_external_project' from project 'executorch')
note: Run script build phase 'Generate third-party/CMakeFiles/flatbuffers_external_project' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'flatbuffers_external_project' from project 'executorch')
note: Run script build phase 'Generate CMakeFiles/ZERO_CHECK' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'ZERO_CHECK' from project 'executorch')
note: Run script build phase 'Generate CMakeFiles/ALL_BUILD' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'ALL_BUILD' from project 'executorch')
note: Run script build phase 'CMake PostBuild Rules' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'extension_apple' from project 'executorch')
** BUILD FAILED **


The following build commands failed:
        CompileC /Users/softmax/Documents/projects/executorch/cmake-out/ios/build/torchao_kernels_aarch64.build/Release-iphoneos/Objects-normal/arm64/find_min_and_max.o /Users/softmax/Documents/projects/executorch/third-party/ao/torchao/experimental/kernels/cpu/aarch64/reduction/find_min_and_max.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'torchao_kernels_aarch64' from project 'executorch')
(1 failure)

)

set(EXECUTORCH_INCLUDE_DIRS ${TORCHAO_INCLUDE_DIRS})

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third-party/ao/torchao/experimental)
executorch_target_link_options_shared_lib(torchao_ops_executorch)
list(APPEND _executorch_kernels torchao_ops_executorch)
endif()

if(EXECUTORCH_BUILD_TESTS)
set(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR ON)
include(CTest)
endif()

# TODO(dbort): Fix these warnings and remove this flag.
set(_common_compile_options -Wno-deprecated-declarations -fPIC)

Expand Down
9 changes: 9 additions & 0 deletions scripts/build_apple_frameworks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ libquantized_kernels.a,\
libquantized_ops_lib.a,\
:"

FRAMEWORK_KERNELS_TORCHAO="kernels_torchao:\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before testing xcframework, let's verify your changes work on macOS desktop first.

libtorchao_ops_executorch.a,\
libtorchao_kernels_aarch64.a,\
:"

usage() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shoumikhin can you review these changes to xcframeworks, and comment on any tests that should be run?

echo "Usage: $0 [OPTIONS]"
echo "Build frameworks for Apple platforms."
Expand All @@ -137,6 +142,7 @@ usage() {
echo " --mps Only build the Metal Performance Shaders backend."
echo " --optimized Only build the Optimized kernels."
echo " --quantized Only build the Quantized kernels."
echo " --torchao Only build the TorchAO kernels."
echo " --xnnpack Only build the XNNPACK backend."
echo
exit 0
Expand All @@ -154,6 +160,7 @@ set_cmake_options_override() {
"-DEXECUTORCH_BUILD_MPS=OFF"
"-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=OFF"
"-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=OFF"
"-DEXECUTORCH_BUILD_KERNELS_TORCHAO=OFF"
"-DEXECUTORCH_BUILD_XNNPACK=OFF"
)
fi
Expand Down Expand Up @@ -184,6 +191,7 @@ for arg in "$@"; do
--mps) set_cmake_options_override "EXECUTORCH_BUILD_MPS" ;;
--optimized) set_cmake_options_override "EXECUTORCH_BUILD_KERNELS_OPTIMIZED" ;;
--quantized) set_cmake_options_override "EXECUTORCH_BUILD_KERNELS_QUANTIZED" ;;
--torchao) set_cmake_options_override "EXECUTORCH_BUILD_KERNELS_TORCHAO" ;;
--xnnpack) set_cmake_options_override "EXECUTORCH_BUILD_XNNPACK" ;;
*)
echo -e "\033[31m[error] unknown option: ${arg}\033[0m"
Expand Down Expand Up @@ -311,6 +319,7 @@ for mode in "${MODES[@]}"; do
append_framework_flag "EXECUTORCH_BUILD_KERNELS_LLM" "$FRAMEWORK_KERNELS_LLM" "$mode"
append_framework_flag "EXECUTORCH_BUILD_KERNELS_OPTIMIZED" "$FRAMEWORK_KERNELS_OPTIMIZED" "$mode"
append_framework_flag "EXECUTORCH_BUILD_KERNELS_QUANTIZED" "$FRAMEWORK_KERNELS_QUANTIZED" "$mode"
append_framework_flag "EXECUTORCH_BUILD_KERNELS_TORCHAO" "$FRAMEWORK_KERNELS_TORCHAO" "$mode"

cd "${OUTPUT_DIR}"
"$SOURCE_ROOT_DIR"/scripts/create_frameworks.sh "${FRAMEWORK_FLAGS[@]}"
Expand Down
2 changes: 2 additions & 0 deletions tools/cmake/executorch-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ set(optional_lib_list
quantized_kernels
quantized_ops_lib
quantized_ops_aot_lib
torchao_ops_executorch
torchao_kernels_aarch64
)

foreach(lib ${optional_lib_list})
Expand Down
1 change: 1 addition & 0 deletions tools/cmake/preset/apple_common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ set_overridable_option(EXECUTORCH_BUILD_EXTENSION_TENSOR ON)
set_overridable_option(EXECUTORCH_BUILD_KERNELS_LLM ON)
set_overridable_option(EXECUTORCH_BUILD_KERNELS_OPTIMIZED ON)
set_overridable_option(EXECUTORCH_BUILD_KERNELS_QUANTIZED ON)
set_overridable_option(EXECUTORCH_BUILD_KERNELS_TORCHAO ON)
Loading