Skip to content

Commit a8812b4

Browse files
rascanifacebook-github-bot
authored andcommitted
Use gpu_cpp_unittest for slim CUDA guard tests
Summary: The `test_cuda_guard` and `test_cuda_stream_guard` targets in `executorch/backends/aoti/slim/cuda/test/` skip at runtime via `GTEST_SKIP()` in `SetUp()` when no CUDA device is available. On CPU-only sandcastle hosts they emit SKIPPED on every run, never accumulate a PASS record, and TestInfra flags them with a `CONTINUOUS_STATE` violation, marking them DISABLED_FAILING and contributing 15 phantom failures to the ai_infra_mobile_platform oncall feed. Switch the wrapper macro from `cpp_unittest` to `gpu_cpp_unittest`. The GPU wrapper expands the kwargs through `gpu_common.convert_cpp_args`, which adds CI labels and the appropriate `select_accelerator()` so Buck marks the targets incompatible with non-GPU configurations. TestInfra then omits them from CPU schedules entirely instead of running and reporting SKIPPED. Authored with Claude. Differential Revision: D104297130
1 parent fa857bd commit a8812b4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

backends/aoti/slim/cuda/test/targets.bzl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest")
1+
load("@fbcode_macros//build_defs:gpu_cpp_unittest.bzl", "gpu_cpp_unittest")
22
load("@fbcode_macros//build_defs/lib:re_test_utils.bzl", "re_test_utils")
33

44
def cuda_slim_cpp_unittest(name):
5-
cpp_unittest(
5+
gpu_cpp_unittest(
66
name = "test_" + name,
77
srcs = [
88
"test_" + name + ".cpp",
@@ -16,6 +16,7 @@ def cuda_slim_cpp_unittest(name):
1616
external_deps = [
1717
("cuda", None, "cuda-lazy"),
1818
],
19+
hip_compatible = False,
1920
keep_gpu_sections = True,
2021
remote_execution = re_test_utils.remote_execution(
2122
platform = "gpu-remote-execution",

0 commit comments

Comments
 (0)