Skip to content

Commit 6b9b412

Browse files
pytorchbotswolchok
andauthored
[ExecuTorch] Add //examples/portable/executor_runner:executor_runner_opt (#9508)
This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: #9291 by @swolchok ^ Please use this as the source of truth for the PR details, comments, and reviews ghstack PR base: https://github.com/pytorch/executorch/tree/gh/swolchok/367/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/swolchok/367/head Merge bot PR base: https://github.com/pytorch/executorch/tree/main Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/swolchok/367/orig @diff-train-skip-merge Co-authored-by: Scott Wolchok <[email protected]>
1 parent d16b867 commit 6b9b412

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

examples/portable/executor_runner/targets.bzl

+54
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_oss_build_kwargs", "runtime")
2+
load("@fbsource//xplat/executorch/codegen:codegen.bzl", "executorch_generated_lib")
23

34
def define_common_targets():
45
"""Defines targets that should be shared between fbcode and xplat.
@@ -27,6 +28,26 @@ def define_common_targets():
2728
],
2829
)
2930

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+
3051
register_custom_op = native.read_config("executorch", "register_custom_op", "0")
3152
register_quantized_ops = native.read_config("executorch", "register_quantized_ops", "0")
3253

@@ -52,3 +73,36 @@ def define_common_targets():
5273
define_static_target = True,
5374
**get_oss_build_kwargs()
5475
)
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

Comments
 (0)