Skip to content

Commit 6a89113

Browse files
committed
rebase atop revert to unbreak tests
[ghstack-poisoned]
2 parents 800800c + 5f78cd5 commit 6a89113

File tree

59 files changed

+1557
-1187
lines changed

Some content is hidden

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

59 files changed

+1557
-1187
lines changed

.Package.swift/kernels_torchao/dummy.swift

Whitespace-only changes.

.Package.swift/kernels_torchao_debug/dummy.swift

Whitespace-only changes.

.ci/scripts/test_llama_torchao_lowbit.sh

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,22 @@ cmake -DPYTHON_EXECUTABLE=python \
2929
-DEXECUTORCH_ENABLE_LOGGING=1 \
3030
-DCMAKE_BUILD_TYPE=Release \
3131
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
32-
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
33-
-DEXECUTORCH_BUILD_EXTENSION_LLM_RUNNER=ON \
34-
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
3532
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
33+
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
3634
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
3735
-DEXECUTORCH_BUILD_XNNPACK=OFF \
3836
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
3937
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
38+
-DEXECUTORCH_BUILD_KERNELS_TORCHAO=ON \
39+
-DEXECUTORCH_BUILD_EXTENSION_LLM_RUNNER=ON \
40+
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
4041
-DEXECUTORCH_BUILD_KERNELS_LLM=ON \
4142
-Bcmake-out .
42-
cmake --build cmake-out -j16 --target install --config Release
43+
cmake --build cmake-out -j16 --config Release --target install
4344

4445
# Install llama runner with torchao
4546
cmake -DPYTHON_EXECUTABLE=python \
46-
-DBUILD_TESTING=OFF \
4747
-DCMAKE_BUILD_TYPE=Release \
48-
-DEXECUTORCH_BUILD_KERNELS_LLM=ON \
49-
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
50-
-DEXECUTORCH_BUILD_XNNPACK=OFF \
51-
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
52-
-DEXECUTORCH_BUILD_TORCHAO=ON \
5348
-Bcmake-out/examples/models/llama \
5449
examples/models/llama
5550
cmake --build cmake-out/examples/models/llama -j16 --config Release

.github/workflows/trunk.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ jobs:
485485
eval "$(conda shell.bash hook)"
486486
487487
# Install requirements
488-
${CONDA_RUN} EXECUTORCH_BUILD_TORCHAO=1 python install_executorch.py
488+
${CONDA_RUN} EXECUTORCH_BUILD_KERNELS_TORCHAO=1 python install_executorch.py
489489
${CONDA_RUN} sh examples/models/llama/install_requirements.sh
490490
491491
# Run test

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
[submodule "backends/arm/third-party/ethos-u-core-driver"]
22
path = backends/arm/third-party/ethos-u-core-driver
33
url = https://git.gitlab.arm.com/artificial-intelligence/ethos-u/ethos-u-core-driver.git
4-
[submodule "backends/arm/third-party/serialization_lib"]
5-
path = backends/arm/third-party/serialization_lib
6-
url = https://git.gitlab.arm.com/tosa/tosa-serialization.git
74
[submodule "backends/vulkan/third-party/Vulkan-Headers"]
85
path = backends/vulkan/third-party/Vulkan-Headers
96
url = https://github.com/KhronosGroup/Vulkan-Headers

CMakeLists.txt

Lines changed: 59 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -279,29 +279,6 @@ if(EXECUTORCH_BUILD_PTHREADPOOL)
279279
)
280280
endif()
281281

282-
if(EXECUTORCH_BUILD_KERNELS_TORCHAO)
283-
set(TORCHAO_BUILD_ATEN_OPS OFF)
284-
set(TORCHAO_BUILD_EXECUTORCH_OPS ON)
285-
set(TORCHAO_BUILD_CPU_AARCH64 ON)
286-
set(TORCHAO_ENABLE_ARM_NEON_DOT ON)
287-
288-
list(
289-
APPEND
290-
TORCHAO_INCLUDE_DIRS
291-
${EXECUTORCH_ROOT}/backends/xnnpack/third-party/pthreadpool/include
292-
${EXECUTORCH_ROOT}/backends/xnnpack/third-party/cpuinfo/include
293-
${EXECUTORCH_ROOT}/third-party/ao
294-
)
295-
296-
set(EXECUTORCH_INCLUDE_DIRS ${TORCHAO_INCLUDE_DIRS})
297-
298-
add_subdirectory(
299-
${CMAKE_CURRENT_SOURCE_DIR}/third-party/ao/torchao/experimental
300-
)
301-
executorch_target_link_options_shared_lib(torchao_ops_executorch)
302-
list(APPEND _executorch_kernels torchao_ops_executorch)
303-
endif()
304-
305282
if(EXECUTORCH_BUILD_TESTS)
306283
set(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR ON)
307284
include(CTest)
@@ -707,6 +684,65 @@ if(EXECUTORCH_BUILD_PTHREADPOOL AND EXECUTORCH_BUILD_CPUINFO)
707684
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/threadpool)
708685
endif()
709686

687+
if(EXECUTORCH_BUILD_KERNELS_TORCHAO)
688+
if(NOT TARGET cpuinfo)
689+
message(
690+
FATAL_ERROR
691+
"EXECUTORCH_BUILD_KERNELS_TORCHAO requires EXECUTORCH_BUILD_CPUINFO be set ON"
692+
)
693+
endif()
694+
if(NOT TARGET pthreadpool)
695+
message(
696+
FATAL_ERROR
697+
"EXECUTORCH_BUILD_KERNELS_TORCHAO requires EXECUTORCH_BUILD_PTHREADPOOL be set ON"
698+
)
699+
endif()
700+
701+
# Configure TorchAO kernels
702+
set(TORCHAO_BUILD_ATEN_OPS OFF)
703+
set(TORCHAO_BUILD_EXECUTORCH_OPS ON)
704+
set(TORCHAO_BUILD_CPU_AARCH64 ON)
705+
set(TORCHAO_ENABLE_ARM_NEON_DOT ON)
706+
set(TORCHAO_BUILD_KLEIDIAI ON)
707+
708+
# TorchAO kernels look for EXECUTORCH_INCLUDE_DIRS
709+
if(DEFINED EXECUTORCH_INCLUDE_DIRS)
710+
message(FATAL_ERROR "EXECUTORCH_INCLUDE_DIRS is already defined")
711+
endif()
712+
set(EXECUTORCH_INCLUDE_DIRS
713+
${EXECUTORCH_ROOT}/backends/xnnpack/third-party/pthreadpool/include
714+
${EXECUTORCH_ROOT}/backends/xnnpack/third-party/cpuinfo/include
715+
)
716+
add_subdirectory(
717+
${CMAKE_CURRENT_SOURCE_DIR}/third-party/ao/torchao/experimental
718+
)
719+
unset(EXECUTORCH_INCLUDE_DIRS)
720+
721+
executorch_target_link_options_shared_lib(torchao_ops_executorch)
722+
list(APPEND _executorch_kernels torchao_ops_executorch)
723+
724+
install(
725+
TARGETS torchao_ops_executorch torchao_kernels_aarch64
726+
EXPORT ExecuTorchTargets
727+
DESTINATION lib
728+
INCLUDES
729+
DESTINATION ${_common_include_directories}
730+
)
731+
# If using KleidiAI and XNNPACK has not installed it already, install it
732+
if(TORCHAO_BUILD_KLEIDIAI AND NOT (EXECUTORCH_BUILD_XNNPACK
733+
AND EXECUTORCH_XNNPACK_ENABLE_KLEIDI)
734+
)
735+
install(
736+
TARGETS kleidiai
737+
EXPORT ExecuTorchTargets
738+
DESTINATION lib
739+
INCLUDES
740+
DESTINATION ${_common_include_directories}
741+
)
742+
endif()
743+
744+
endif()
745+
710746
if(EXECUTORCH_BUILD_PYBIND)
711747

712748
# Add codegen tools subdirectory for selective_build pybind module

Package.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ let products = deliverables([
8484
],
8585
],
8686
"kernels_quantized": [:],
87+
"kernels_torchao": [
88+
"targets": [
89+
"threadpool",
90+
],
91+
],
8792
])
8893

8994
let targets = deliverables([

backends/apple/coreml/TARGETS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ runtime.python_test(
120120
"test/*.py",
121121
]),
122122
deps = [
123-
"fbsource//third-party/pypi/coremltools:coremltools",
124123
"fbsource//third-party/pypi/pytest:pytest",
125124
":partitioner",
126125
":quantizer",

0 commit comments

Comments
 (0)