migrate backends/cuda/runtime/shims/tests (fbcode-only CUDA tests) - #21427
Conversation
Summary: Chunk 11 of fbcode/executorch TARGETS->BUCK migration. 5 directories that had only a TARGETS file with substantive fbcode-only content but were skipped from earlier chunks for various reasons (`fbcode_target(`, `fbcode_macros`, fbcode-only kwargs, etc.). Same chunk-6 pattern: created `targets.bzl` with `define_common_targets(is_fbcode = False)` whose body opens with `if not is_fbcode: return`, replaced TARGETS with a thin BUCK calling `define_common_targets(is_fbcode = is_fbcode())`. Directories migrated: - backends/aoti/tests - backends/cuda/runtime - backends/cuda/tests - extension/pybindings/fb - extension/pytree/test Differential Revision: D109082053
Summary: Add is_fbcode param to define_common_targets and early-return outside fbcode. The cxx_test rules use fbcode-only kwargs (keep_gpu_sections, re_test_utils.remote_execution) and were never evaluated in xplat (TARGETS-only pre-migration). Replaced TARGETS with thin BUCK calling define_common_targets(is_fbcode = is_fbcode()). Differential Revision: D109082041
Summary: Add is_fbcode early-return to existing define_common_targets. The cpp_unittest rules use fbcode-only kwargs (keep_gpu_sections, re_test_utils.remote_execution) and can't run in xplat. Replaced TARGETS with thin BUCK. Differential Revision: D109082049
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21427
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New Failures, 1 Unrelated FailureAs of commit 580f947 with merge base c7b6f52 ( NEW FAILURES - The following jobs have failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@bigfootjon has exported this pull request. If you are a Meta employee, you can view the originating Diff in D109082049. |
This PR needs a
|
There was a problem hiding this comment.
Pull request overview
This PR migrates several Buck TARGETS-only test directories to a BUCK + targets.bzl pattern, while gating fbcode-only test rules behind an is_fbcode early-return so xplat evaluation preserves prior behavior (i.e., these targets are not defined outside fbcode).
Changes:
- Added
define_common_targets(is_fbcode=...)wrappers (with early return) for multiple test directories that rely on fbcode-only macros/kwargs. - Replaced
TARGETSfiles with thinBUCKfiles that call intotargets.bzl. - Introduced/updated CUDA/AOTI-related target definitions under the new structure.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| extension/pytree/test/targets.bzl | Defines pytree C++/Python unit tests behind an is_fbcode guard. |
| extension/pytree/test/TARGETS | Removed legacy TARGETS-based definitions. |
| extension/pytree/test/BUCK | Thin entrypoint calling define_common_targets(is_fbcode = is_fbcode()). |
| backends/cuda/tests/targets.bzl | Defines CUDA python unittests (incl. remote GPU test) behind is_fbcode guard. |
| backends/cuda/tests/TARGETS | Removed legacy TARGETS-based definitions. |
| backends/cuda/tests/BUCK | Thin entrypoint calling into targets.bzl. |
| backends/cuda/runtime/targets.bzl | Defines CUDA runtime libraries + C++ unittests behind is_fbcode guard. |
| backends/cuda/runtime/TARGETS | Removed legacy TARGETS-based definitions. |
| backends/cuda/runtime/BUCK | Thin entrypoint calling into targets.bzl. |
| backends/cuda/runtime/shims/tests/targets.bzl | Updates common-target definition to accept is_fbcode and early-return. |
| backends/cuda/runtime/shims/tests/TARGETS | Removed legacy TARGETS-based definitions. |
| backends/cuda/runtime/shims/tests/BUCK | Thin entrypoint calling into targets.bzl. |
| backends/aoti/tests/targets.bzl | Defines AOTI C++ unittests behind is_fbcode guard. |
| backends/aoti/tests/TARGETS | Removed legacy TARGETS-based definitions. |
| backends/aoti/tests/BUCK | Thin entrypoint calling into targets.bzl. |
| backends/aoti/slim/factory/test/targets.bzl | Updates SlimTensor factory tests to accept is_fbcode and early-return. |
| backends/aoti/slim/factory/test/TARGETS | Removed legacy TARGETS-based definitions. |
| backends/aoti/slim/factory/test/BUCK | Thin entrypoint calling into targets.bzl. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") | ||
| load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") | ||
| load("@fbcode_macros//build_defs:python_unittest_remote_gpu.bzl", "python_unittest_remote_gpu") | ||
| load("@fbcode_macros//build_defs/lib:re_test_utils.bzl", "re_test_utils") | ||
|
|
| """Defines targets that should be shared between fbcode and xplat. | ||
|
|
||
| The directory containing this targets.bzl file should also contain both | ||
| TARGETS and BUCK files that call this function. | ||
| Uses fbcode-only macros (cpp_unittest, re_test_utils) and kwargs | ||
| (keep_gpu_sections), so we early-return outside fbcode to preserve | ||
| pre-migration behavior (this dir was originally TARGETS-only). |
| deps = [ | ||
| ":cuda_platform", | ||
| ":runtime_shims", | ||
| ":cuda_allocator", | ||
| ":cuda_platform", | ||
| "//executorch/backends/aoti:aoti_common_slim", |
| deps = [ | ||
| "//executorch/backends/aoti:common_shims", | ||
| "//executorch/extension/tensor:tensor", | ||
| "//executorch/runtime/core:core", | ||
| "//executorch/runtime/platform:platform", | ||
| "//executorch/runtime/core/exec_aten/testing_util:tensor_util", | ||
| "//executorch/runtime/core/exec_aten:lib", | ||
| "//executorch/extension/tensor:tensor", | ||
| ], |
ndmitchell
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Summary:
Add is_fbcode early-return to existing define_common_targets. The cpp_unittest
rules use fbcode-only kwargs (keep_gpu_sections, re_test_utils.remote_execution)
and can't run in xplat. Replaced TARGETS with thin BUCK.
Differential Revision: D109082049