1
1
load ("@fbsource//xplat/executorch/build:runtime_wrapper.bzl" , "get_oss_build_kwargs" , "runtime" )
2
+ load ("@fbsource//xplat/executorch/codegen:codegen.bzl" , "executorch_generated_lib" )
2
3
3
4
def define_common_targets ():
4
5
"""Defines targets that should be shared between fbcode and xplat.
@@ -27,6 +28,26 @@ def define_common_targets():
27
28
],
28
29
)
29
30
31
+ runtime .cxx_library (
32
+ name = "executor_runner_lib_with_threadpool" ,
33
+ srcs = ["executor_runner.cpp" ],
34
+ deps = [
35
+ "//executorch/runtime/executor:program" ,
36
+ "//executorch/extension/data_loader:file_data_loader" ,
37
+ "//executorch/extension/evalue_util:print_evalue" ,
38
+ "//executorch/extension/runner_util:inputs" ,
39
+ "//executorch/extension/threadpool:cpuinfo_utils" ,
40
+ "//executorch/extension/threadpool:threadpool" ,
41
+ ],
42
+ external_deps = [
43
+ "gflags" ,
44
+ ],
45
+ define_static_target = True ,
46
+ visibility = [
47
+ "//executorch/examples/..." ,
48
+ ],
49
+ )
50
+
30
51
register_custom_op = native .read_config ("executorch" , "register_custom_op" , "0" )
31
52
register_quantized_ops = native .read_config ("executorch" , "register_quantized_ops" , "0" )
32
53
@@ -52,3 +73,36 @@ def define_common_targets():
52
73
define_static_target = True ,
53
74
** get_oss_build_kwargs ()
54
75
)
76
+
77
+ executorch_generated_lib (
78
+ name = "generated_op_lib_for_runner" ,
79
+ deps = [
80
+ "//executorch/kernels/optimized:optimized_operators" ,
81
+ "//executorch/kernels/optimized:optimized_oplist" ,
82
+ "//executorch/kernels/portable:executorch_aten_ops" ,
83
+ "//executorch/kernels/portable:executorch_custom_ops" ,
84
+ "//executorch/kernels/portable:operators" ,
85
+ ],
86
+ custom_ops_aten_kernel_deps = [
87
+ "//executorch/kernels/portable:operators_aten" ,
88
+ ],
89
+ functions_yaml_target = "//executorch/kernels/optimized:optimized.yaml" ,
90
+ custom_ops_yaml_target = "//executorch/kernels/portable:custom_ops.yaml" ,
91
+ fallback_yaml_target = "//executorch/kernels/portable:functions.yaml" ,
92
+ define_static_targets = True ,
93
+ )
94
+
95
+ # Test driver for models, should have all fast CPU kernels
96
+ # (XNNPACK, custom SDPA, etc.) available.
97
+ runtime .cxx_binary (
98
+ name = "executor_runner_opt" ,
99
+ srcs = [],
100
+ deps = [
101
+ ":executor_runner_lib_with_threadpool" ,
102
+ ":generated_op_lib_for_runner" ,
103
+ "//executorch/backends/xnnpack:xnnpack_backend" ,
104
+ "//executorch/configurations:executor_cpu_optimized" ,
105
+ "//executorch/extension/llm/custom_ops:custom_ops" ,
106
+ "//executorch/kernels/quantized:generated_lib" ,
107
+ ],
108
+ )
0 commit comments