Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 3 additions & 1 deletion .ci/scripts/unittest-buck2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ BUILDABLE_KERNELS_PRIM_OPS_TARGETS=$(buck2 query //kernels/prim_ops/... | grep -
# TODO: expand the covered scope of Buck targets.
# //runtime/kernel/... is failing because //third-party:torchgen_files's shell script can't find python on PATH.
# //runtime/test/... requires Python torch, which we don't have in our OSS buck setup.
buck2 test $BUILDABLE_OPTIMIZED_OPS //kernels/portable/... \
buck2 test \
//examples/selective_build:select_all_dtype_selective_lib_portable_lib \
$BUILDABLE_OPTIMIZED_OPS //kernels/portable/... \
$BUILDABLE_KERNELS_PRIM_OPS_TARGETS //runtime/backend/... //runtime/core/... \
//runtime/executor: //runtime/kernel/... //runtime/platform/...
15 changes: 15 additions & 0 deletions examples/selective_build/targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ def define_common_targets():
],
)

executorch_generated_lib(
name = "select_all_dtype_selective_lib",
functions_yaml_target = "//executorch/kernels/portable:functions.yaml",
kernel_deps = [
"//executorch/kernels/portable:operators",
],
# Setting dtype_selective_build without using list or dict selection isn't a
# typical use case; we just do it here so that we can test that our mechanism
# for getting buck deps right for dtype_selective_build is working.
dtype_selective_build = True,
deps = [
":select_all_ops",
],
)

# Select a list of operators: defined in `ops`
et_operator_library(
name = "select_ops_in_list",
Expand Down
6 changes: 4 additions & 2 deletions kernels/portable/cpu/pattern/targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def define_common_targets():
# build, where the portable ops are built from source and linked with :all_deps
runtime.cxx_library(
name = "all_deps",
deps = [
exported_deps = [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's odd that this wasn't required internally

"//executorch/kernels/portable/cpu/pattern:pattern",
"//executorch/kernels/portable/cpu/pattern:bitwise_op",
"//executorch/kernels/portable/cpu/pattern:comparison_op",
Expand Down Expand Up @@ -54,14 +54,16 @@ def define_common_targets():
"unary_ufunc_realhbbf16_to_floathbf16.cpp",
"unary_ufunc_realh.cpp",
],
exported_deps = [
"//executorch/runtime/kernel:kernel_includes",
],
exported_headers = [
"pattern.h",
],
compiler_flags = ["-Wno-missing-prototypes"],
deps = [
"//executorch/kernels/portable/cpu/util:broadcast_util",
"//executorch/kernels/portable/cpu/util:functional_util",
"//executorch/runtime/kernel:kernel_includes",
],
visibility = ["//executorch/kernels/portable/cpu/...", "//executorch/kernels/optimized/cpu/..."],
)
2 changes: 1 addition & 1 deletion kernels/portable/cpu/util/targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def define_common_targets():
# build, where the portable ops are built from source and linked with :all_deps
runtime.cxx_library(
name = "all_deps",
deps = [
exported_deps = [
"//executorch/kernels/portable/cpu/util:functional_util",
"//executorch/kernels/portable/cpu/util:broadcast_util",
"//executorch/kernels/portable/cpu/util:kernel_ops_util",
Expand Down
2 changes: 1 addition & 1 deletion shim_et/xplat/executorch/codegen/codegen.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ def executorch_generated_lib(
)

portable_lib = []
if dtype_selective_build and is_xplat() and "//executorch/kernels/portable:operators" in kernel_deps:
if dtype_selective_build and (is_xplat() or runtime.is_oss) and "//executorch/kernels/portable:operators" in kernel_deps:
# Remove portable from kernel_deps as we're building it from source.
kernel_deps.remove("//executorch/kernels/portable:operators")

Expand Down
Loading