File tree Expand file tree Collapse file tree 7 files changed +26
-3
lines changed 
llama3_2_vision/preprocess Expand file tree Collapse file tree 7 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ build_cmake_executor_runner() {
5353  rm -rf ${CMAKE_OUTPUT_DIR} 
5454  cmake -DCMAKE_BUILD_TYPE=Debug \
5555      -DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
56+       -DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
5657      -DPYTHON_EXECUTABLE=" $PYTHON_EXECUTABLE "   \
5758      -B${CMAKE_OUTPUT_DIR}  . 
5859
@@ -82,6 +83,9 @@ test_model() {
8283    rm " ./${MODEL_NAME} .pte" 
8384  fi 
8485  STRICT=" --strict" 
86+   if  [[ " ${MODEL_NAME} "   ==  " clip"   ]];  then 
87+     STRICT=" --no-strict" 
88+   fi 
8589  if  [[ " ${MODEL_NAME} "   ==  " llava"   ]];  then 
8690    #  Install requirements for llava
8791    bash examples/models/llava/install_requirements.sh
Original file line number Diff line number Diff line change @@ -820,6 +820,11 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
820820    list (APPEND  _executor_runner_libs quantized_ops_lib)
821821  endif ()
822822
823+   if (EXECUTORCH_BUILD_KERNELS_CUSTOM)
824+     list (APPEND  _executor_runner_libs custom_ops)
825+     target_link_options_shared_lib(custom_ops)
826+   endif ()
827+ 
823828  add_executable (executor_runner ${_executor_runner__srcs} )
824829  if (CMAKE_BUILD_TYPE  STREQUAL  "Release" )
825830    if (APPLE )
Original file line number Diff line number Diff line change 3030    "resnet18" : ("resnet" , "ResNet18Model" ),
3131    "resnet50" : ("resnet" , "ResNet50Model" ),
3232    "llava" : ("llava" , "LlavaModel" ),
33+     "clip" : ("llama3_2_vision.preprocess" , "CLIPImageTransformModel" ),
3334}
3435
3536__all__  =  [
Original file line number Diff line number Diff line change 1+ # Copyright (c) Meta Platforms, Inc. and affiliates. 
2+ # All rights reserved. 
3+ # 
4+ # This source code is licensed under the BSD-style license found in the 
5+ # LICENSE file in the root directory of this source tree. 
6+ 
7+ from  .model  import  CLIPImageTransformModel 
8+ 
9+ __all__  =  [
10+     CLIPImageTransformModel ,
11+ ]
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ class PreprocessConfig:
3131class  CLIPImageTransformModel (EagerModelBase ):
3232    def  __init__ (
3333        self ,
34-         config : PreprocessConfig ,
34+         config : PreprocessConfig   =   PreprocessConfig () ,
3535    ):
3636        super ().__init__ ()
3737
Original file line number Diff line number Diff line change @@ -53,8 +53,10 @@ else()
5353  list (APPEND  custom_ops_libs extension_threadpool xnnpack_backend)
5454endif ()
5555
56+ message (INFO, "LUCY custom ops srcs: ${_custom_ops__srcs} " )
5657add_library (custom_ops ${_custom_ops__srcs} )
5758
59+ message (INFO, "LUCY common include dirs ${_common_include_directories} " )
5860target_include_directories (custom_ops PUBLIC  "${_common_include_directories} " )
5961target_include_directories (
6062  custom_ops PRIVATE  "${CMAKE_CURRENT_BINARY_DIR} /../../../include" 
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ def define_common_targets():
3333            deps  =  [
3434                "//executorch/kernels/portable/cpu/util:reduce_util" ,
3535                "//executorch/extension/llm/custom_ops/spinquant:fast_hadamard_transform" ,
36+                 ":op_tile_crop" ,
3637            ],
3738            compiler_flags  =  ["-Wno-missing-prototypes" , "-Wno-global-constructors" ],
3839            visibility  =  [
@@ -50,10 +51,8 @@ def define_common_targets():
5051            srcs  =  [
5152                "op_fast_hadamard_transform_aten.cpp" ,
5253                "op_sdpa_aot.cpp" ,
53-                 "op_tile_crop.cpp" ,
5454                "op_tile_crop_aot.cpp" ,
5555            ],
56-             headers  =  ["op_tile_crop.h" ],
5756            compiler_flags  =  ["-Wno-global-constructors" ],
5857            visibility  =  [
5958                "//executorch/..." ,
@@ -64,6 +63,7 @@ def define_common_targets():
6463            ],
6564            deps  =  [
6665                ":custom_ops"  +  mkl_dep ,
66+                 ":op_tile_crop" ,
6767                "//executorch/extension/aten_util:aten_bridge" ,
6868            ],
6969        )
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments