migrate backends/apple/coreml (TARGETS+BUCK both with rules) - #21429
migrate backends/apple/coreml (TARGETS+BUCK both with rules)#21429bigfootjon wants to merge 5 commits into
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
Summary: Add is_fbcode early-return; replace TARGETS with thin BUCK. Differential Revision: D109082042
Summary: TARGETS contained fbcode-only Python rules (placeholder backend imports); BUCK contained xplat-only Apple platform cxx_library targets. Created a new targets.bzl with define_common_targets(is_fbcode = False) whose body splits via if/else: fbcode branch holds the Python rules, xplat branch holds the Apple cxx targets. Replaced BUCK with thin caller, deleted TARGETS. Differential Revision: D109082057
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21429
Note: Links to docs will display an error until the docs builds have been completed. ❌ 4 New Failures, 1 Unrelated FailureAs of commit a0ef20e 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 D109082057. |
This PR needs a
|
There was a problem hiding this comment.
Pull request overview
This PR continues the migration away from standalone TARGETS files by consolidating fbcode-only and xplat-only Buck targets into targets.bzl (with define_common_targets(is_fbcode=...)) and switching directories to a thin BUCK caller that gates behavior via is_fbcode().
Changes:
- Introduce/extend
define_common_targets(is_fbcode = False)patterns in several directories to preserve fbcode-vs-xplat behavior while deletingTARGETS. - Add thin
BUCKentrypoints that calldefine_common_targets(is_fbcode = is_fbcode()). - Migrate
backends/apple/coremlto a singletargets.bzlwith explicit fbcode/xplat branching and simplify itsBUCK.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| extension/pytree/test/targets.bzl | New gated target definitions (fbcode-only) moved out of TARGETS. |
| extension/pytree/test/TARGETS | Deleted in favor of targets.bzl + thin BUCK. |
| extension/pytree/test/BUCK | New thin caller invoking define_common_targets(is_fbcode=...). |
| examples/models/llama/config/targets.bzl | Gate existing unittest target definitions on is_fbcode. |
| examples/models/llama/config/TARGETS | Deleted; migration to BUCK+targets.bzl calling convention. |
| examples/models/llama/config/BUCK | New thin caller invoking define_common_targets(is_fbcode=...). |
| backends/cuda/tests/targets.bzl | New gated CUDA test target definitions moved out of TARGETS. |
| backends/cuda/tests/TARGETS | Deleted in favor of targets.bzl + thin BUCK. |
| backends/cuda/tests/BUCK | New thin caller invoking define_common_targets(is_fbcode=...). |
| backends/cuda/runtime/targets.bzl | New gated CUDA runtime + tests target definitions moved out of TARGETS. |
| backends/cuda/runtime/TARGETS | Deleted in favor of targets.bzl + thin BUCK. |
| backends/cuda/runtime/BUCK | New thin caller invoking define_common_targets(is_fbcode=...). |
| backends/cuda/runtime/shims/tests/targets.bzl | Update common-targets entrypoint to accept is_fbcode gating. |
| backends/cuda/runtime/shims/tests/TARGETS | Deleted in favor of targets.bzl + thin BUCK. |
| backends/cuda/runtime/shims/tests/BUCK | New thin caller invoking define_common_targets(is_fbcode=...). |
| backends/apple/coreml/targets.bzl | New combined fbcode/xplat target definitions with explicit branch split. |
| backends/apple/coreml/TARGETS | Deleted after moving fbcode Python rules into targets.bzl. |
| backends/apple/coreml/BUCK | Reduced to a thin caller into targets.bzl gated by is_fbcode(). |
| backends/aoti/tests/targets.bzl | New gated AOTI test target definitions moved out of TARGETS. |
| backends/aoti/tests/TARGETS | Deleted in favor of targets.bzl + thin BUCK. |
| backends/aoti/tests/BUCK | New thin caller invoking define_common_targets(is_fbcode=...). |
| backends/aoti/slim/factory/test/targets.bzl | Gate existing slim factory tests on is_fbcode to preserve prior behavior. |
| backends/aoti/slim/factory/test/TARGETS | Deleted in favor of targets.bzl + thin BUCK. |
| backends/aoti/slim/factory/test/BUCK | New thin caller invoking define_common_targets(is_fbcode=...). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ":cuda_platform", | ||
| ":runtime_shims", | ||
| ":cuda_allocator", | ||
| ":cuda_platform", | ||
| "//executorch/backends/aoti:aoti_common_slim", |
| "//executorch/extension/tensor:tensor", | ||
| ], |
| load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") | ||
| load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") | ||
|
|
| 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") | ||
|
|
ndmitchell
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Summary:
TARGETS contained fbcode-only Python rules (placeholder backend imports);
BUCK contained xplat-only Apple platform cxx_library targets. Created a
new targets.bzl with define_common_targets(is_fbcode = False) whose body
splits via if/else: fbcode branch holds the Python rules, xplat branch
holds the Apple cxx targets. Replaced BUCK with thin caller, deleted
TARGETS.
Differential Revision: D109082057