Skip to content

Commit ec0d70e

Browse files
committed
Add xplat cxx_binary target for bench_sdpa
Pull Request resolved: #18705 Add non_fbcode_target cxx_binary so bench_sdpa can be built via the xplat build path (e.g. for on-device testing). Wrap the existing cpp_benchmark in fbcode_target to avoid name collision between the fbcode benchmark target and the xplat binary target. ghstack-source-id: 376092494 @exported-using-ghexport Differential Revision: [D96044315](https://our.internmc.facebook.com/intern/diff/D96044315/)
1 parent 36a2aef commit ec0d70e

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

  • extension/llm/custom_ops

extension/llm/custom_ops/BUCK

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
22
load("@fbcode_macros//build_defs:cpp_benchmark.bzl", "cpp_benchmark")
3+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
34
oncall("executorch")
45
# Any targets that should be shared between fbcode and xplat must be defined in
56
# targets.bzl. This file can contain xplat-only targets.
@@ -9,12 +10,25 @@ load(":targets.bzl", "define_common_targets")
910

1011
non_fbcode_target(_kind = define_common_targets,)
1112

13+
non_fbcode_target(_kind = runtime.cxx_binary,
14+
name = "bench_sdpa",
15+
srcs = ["bench_sdpa.cpp"],
16+
compiler_flags = ["-O2"],
17+
deps = [
18+
"fbsource//third-party/benchmark:benchmark",
19+
"//executorch/extension/llm/custom_ops:custom_ops",
20+
"//executorch/extension/threadpool:threadpool",
21+
"//executorch/kernels/optimized:libblas",
22+
"//executorch/runtime/core/exec_aten:lib",
23+
"//executorch/runtime/core/exec_aten/testing_util:tensor_util",
24+
],
25+
)
26+
1227
# !!!! fbcode/executorch/extension/llm/custom_ops/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!!
1328

1429
# Any targets that should be shared between fbcode and xplat must be defined in
1530
# targets.bzl. This file can contain fbcode-only targets.
1631

17-
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
1832
load(":targets.bzl", "define_common_targets")
1933

2034

0 commit comments

Comments
 (0)