Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .ci/scripts/test_model.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ build_cmake_executor_runner() {
rm -rf ${CMAKE_OUTPUT_DIR}
cmake -DCMAKE_BUILD_TYPE=Debug \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
-B${CMAKE_OUTPUT_DIR} .

Expand Down Expand Up @@ -82,6 +83,9 @@ test_model() {
rm "./${MODEL_NAME}.pte"
fi
STRICT="--strict"
if [[ "${MODEL_NAME}" == "clip" ]]; then
STRICT="--no-strict"
fi
if [[ "${MODEL_NAME}" == "llava" ]]; then
# Install requirements for llava
bash examples/models/llava/install_requirements.sh
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,11 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
list(APPEND _executor_runner_libs quantized_ops_lib)
endif()

if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
list(APPEND _executor_runner_libs custom_ops)
target_link_options_shared_lib(custom_ops)
endif()

add_executable(executor_runner ${_executor_runner__srcs})
if(CMAKE_BUILD_TYPE STREQUAL "Release")
if(APPLE)
Expand Down
1 change: 1 addition & 0 deletions examples/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"resnet18": ("resnet", "ResNet18Model"),
"resnet50": ("resnet", "ResNet50Model"),
"llava": ("llava", "LlavaModel"),
"clip": ("llama3_2_vision.preprocess", "CLIPImageTransformModel"),
}

__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion examples/models/llama3_2_vision/install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ pip install --pre torchtune --extra-index-url https://download.pytorch.org/whl/n

# Install torchao.
TORCHAO_VERSION=$(cat "$(dirname "$0")"/../../../.ci/docker/ci_commit_pins/torchao.txt)
pip install --no-use-pep517 "git+https://github.com/pytorch/ao.git@${TORCHAO_VERSION}"
pip install "git+https://github.com/pytorch/ao.git@${TORCHAO_VERSION}"
11 changes: 11 additions & 0 deletions examples/models/llama3_2_vision/preprocess/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

from .model import CLIPImageTransformModel

__all__ = [
CLIPImageTransformModel,
]
4 changes: 2 additions & 2 deletions extension/llm/custom_ops/targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def define_common_targets():
deps = [
"//executorch/kernels/portable/cpu/util:reduce_util",
"//executorch/extension/llm/custom_ops/spinquant:fast_hadamard_transform",
":op_tile_crop",
],
compiler_flags = ["-Wno-missing-prototypes", "-Wno-global-constructors"] + get_compiler_optimization_flags(),
visibility = [
Expand All @@ -55,10 +56,8 @@ def define_common_targets():
srcs = [
"op_fast_hadamard_transform_aten.cpp",
"op_sdpa_aot.cpp",
"op_tile_crop.cpp",
"op_tile_crop_aot.cpp",
],
headers = ["op_tile_crop.h"],
compiler_flags = ["-Wno-global-constructors"],
visibility = [
"//executorch/...",
Expand All @@ -69,6 +68,7 @@ def define_common_targets():
],
deps = [
":custom_ops" + mkl_dep,
":op_tile_crop",
"//executorch/extension/aten_util:aten_bridge",
],
)
Expand Down
Loading