Skip to content

Commit 0bbfae4

Browse files
committed
rebase atop revert to unbreak tests
[ghstack-poisoned]
2 parents 152662a + 80a974a commit 0bbfae4

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)
@@ -706,6 +683,65 @@ if(EXECUTORCH_BUILD_PTHREADPOOL AND EXECUTORCH_BUILD_CPUINFO)
706683
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/threadpool)
707684
endif()
708685

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

711747
# 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)