Skip to content

Query most of //kernels in unittest buck #9040

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 10 additions & 4 deletions .ci/scripts/unittest-buck2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ set -eux

# TODO: expand this to //...
# TODO: can't query cadence & vulkan backends
# TODO: can't query //kernels/prim_ops because of a cpp_unittest and
# broken code in shim to read oss.folly_cxx_tests. Sending fix but it
# needs to propagate and we need a submodule update.
buck2 query "//backends/apple/... + //backends/example/... + \
//backends/mediatek/... + //backends/test/... + //backends/transforms/... + \
//backends/xnnpack/... + //configurations/... + //kernels/portable/cpu/... + \
//runtime/... + //schema/... + //test/... + //util/..."
//backends/xnnpack/... + //configurations/... + //kernels/aten/... + \
//kernels/optimized/... + //kernels/portable/... + //kernels/quantized/... + \
//kernels/test/... + //runtime/... + //schema/... + //test/... + //util/..."

# TODO: expand the covered scope of Buck targets.
buck2 build //runtime/core/portable_type/...
buck2 test //runtime/core/portable_type/...
# //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 build //runtime/backend/... //runtime/core/... //runtime/executor: //runtime/kernel/... //runtime/platform/...
buck2 test //runtime/backend/... //runtime/core/... //runtime/executor: //runtime/kernel/... //runtime/platform/...
28 changes: 12 additions & 16 deletions runtime/core/exec_aten/testing_util/test/targets.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime")

def define_common_targets():
"""Defines targets that should be shared between fbcode and xplat.
Expand All @@ -15,19 +15,15 @@ def define_common_targets():
],
)

runtime.cxx_test(
name = "tensor_factory_test",
srcs = ["tensor_factory_test.cpp"],
deps = [
"//executorch/runtime/core/exec_aten/testing_util:tensor_util",
],
)
for aten_mode in get_aten_mode_options():
aten_suffix = "_aten" if aten_mode else ""
preprocessor_flags = ["-DUSE_ATEN_LIB"] if aten_mode else []

runtime.cxx_test(
name = "tensor_factory_test_aten",
srcs = ["tensor_factory_test.cpp"],
preprocessor_flags = ["-DUSE_ATEN_LIB"],
deps = [
"//executorch/runtime/core/exec_aten/testing_util:tensor_util_aten",
],
)
runtime.cxx_test(
name = "tensor_factory_test" + aten_suffix,
srcs = ["tensor_factory_test.cpp"],
preprocessor_flags = preprocessor_flags,
deps = [
"//executorch/runtime/core/exec_aten/testing_util:tensor_util" + aten_suffix,
],
)
17 changes: 9 additions & 8 deletions runtime/core/test/targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,15 @@ def define_common_targets():
],
)

runtime.cxx_test(
name = "tensor_shape_dynamism_test_aten",
srcs = ["tensor_shape_dynamism_test_aten.cpp"],
deps = [
"//executorch/runtime/core/exec_aten:lib_aten",
"//executorch/runtime/core/exec_aten/testing_util:tensor_util_aten",
],
)
if True in get_aten_mode_options():
runtime.cxx_test(
name = "tensor_shape_dynamism_test_aten",
srcs = ["tensor_shape_dynamism_test_aten.cpp"],
deps = [
"//executorch/runtime/core/exec_aten:lib_aten",
"//executorch/runtime/core/exec_aten/testing_util:tensor_util_aten",
],
)

for aten_mode in get_aten_mode_options():
aten_suffix = "_aten" if aten_mode else ""
Expand Down
Loading