Clean up remaining TARGETS files (#21462) - #21462
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21462
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 33 PendingAs of commit 3efefcc with merge base d8c6be2 ( 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 D113976390. |
This PR needs a
|
There was a problem hiding this comment.
Pull request overview
This PR finishes migrating several remaining fbcode-only TARGETS build definitions to the newer pattern of BUCK files delegating into targets.bzl, keeping fbcode/xplat behavior splits explicit via is_fbcode() gating.
Changes:
- Replaced multiple
TARGETSfiles withBUCKwrappers that calldefine_common_targets(...)fromtargets.bzl. - Added new
targets.bzlfiles to host the migrated target definitions and preserve fbcode vs xplat behavior. - Introduced/updated a few migration helper wrappers (
fbcode_target,non_fbcode_target) for Buck build file parity.
Reviewed changes
Copilot reviewed 36 out of 37 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| runtime/test/targets.bzl | New fbcode-gated runtime python tests moved out of TARGETS. |
| runtime/test/TARGETS | Deleted; targets migrated to targets.bzl + BUCK. |
| runtime/test/BUCK | New wrapper calling define_common_targets(is_fbcode=...). |
| extension/pytree/test/targets.bzl | New fbcode-gated cpp/python unittest targets moved out of TARGETS. |
| extension/pytree/test/TARGETS | Deleted; targets migrated to targets.bzl + BUCK. |
| extension/pytree/test/BUCK | New wrapper calling define_common_targets(is_fbcode=...). |
| examples/models/llama/config/targets.bzl | Updated to accept is_fbcode and early-return outside fbcode. |
| examples/models/llama/config/TARGETS | Deleted; wrapper responsibilities moved to BUCK. |
| examples/models/llama/config/BUCK | New wrapper calling define_common_targets(is_fbcode=...). |
| examples/models/gemma4_31b/BUCK | New fbcode python_library targets for quantization utilities. |
| examples/llm_server/python/BUCK | Migrated python_library to fbcode_target wrapper. |
| backends/vulkan/tools/gpuinfo/targets.bzl | New combined fbcode+xplat target definitions moved out of TARGETS/BUCK. |
| backends/vulkan/tools/gpuinfo/TARGETS | Deleted; targets migrated into targets.bzl. |
| backends/vulkan/tools/gpuinfo/BUCK | Simplified to a wrapper calling define_common_targets(is_fbcode=...). |
| backends/vulkan/test/targets.bzl | New combined fbcode+xplat split for tests + compute API targets. |
| backends/vulkan/test/TARGETS | Deleted; targets migrated into targets.bzl. |
| backends/vulkan/test/BUCK | Wrapper calling define_common_targets(is_fbcode=...). |
| backends/mediatek/runtime/TARGETS | Present in PR metadata; no diff shown in provided snippet. |
| backends/mediatek/runtime/BUCK | Wraps runtime.cxx_library with non_fbcode_target. |
| backends/cuda/tests/targets.bzl | New fbcode-gated CUDA test targets moved out of TARGETS. |
| backends/cuda/tests/TARGETS | Deleted; targets migrated to targets.bzl + BUCK. |
| backends/cuda/tests/BUCK | New wrapper calling define_common_targets(is_fbcode=...). |
| backends/cuda/runtime/targets.bzl | New fbcode-gated CUDA runtime targets moved out of TARGETS. |
| backends/cuda/runtime/TARGETS | Deleted; targets migrated to targets.bzl + BUCK. |
| backends/cuda/runtime/shims/tests/targets.bzl | Updated to accept is_fbcode and early-return outside fbcode. |
| backends/cuda/runtime/shims/tests/TARGETS | Deleted; targets migrated to targets.bzl + BUCK. |
| backends/cuda/runtime/shims/tests/BUCK | New wrapper calling define_common_targets(is_fbcode=...). |
| backends/cuda/runtime/BUCK | New wrapper calling define_common_targets(is_fbcode=...). |
| backends/apple/coreml/targets.bzl | New combined fbcode+xplat split preserving prior TARGETS-vs-BUCK behavior. |
| backends/apple/coreml/TARGETS | Deleted; fbcode-only definitions moved into targets.bzl. |
| backends/apple/coreml/BUCK | Simplified to a wrapper calling define_common_targets(is_fbcode=...). |
| backends/aoti/tests/targets.bzl | New fbcode-gated AOTI test targets moved out of TARGETS. |
| backends/aoti/tests/TARGETS | Deleted; targets migrated to targets.bzl + BUCK. |
| backends/aoti/tests/BUCK | New wrapper calling define_common_targets(is_fbcode=...). |
| backends/aoti/slim/factory/test/targets.bzl | Updated to accept is_fbcode and early-return outside fbcode. |
| backends/aoti/slim/factory/test/TARGETS | Deleted; targets migrated to targets.bzl + BUCK. |
| backends/aoti/slim/factory/test/BUCK | New wrapper calling define_common_targets(is_fbcode=...). |
Comments suppressed due to low confidence (1)
examples/models/gemma4_31b/BUCK:30
- This
python_libraryalso setsbase_module = "executorch.examples.models.gemma4_31b"but doesn’t include__init__.pyinsrcs, which can prevent importing the package when this target is the only provider of that module tree.
srcs = ["quantize_and_save.py"],
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| srcs = [ | ||
| "cuda_packers.py", | ||
| "quant/quantize.py", | ||
| "quant/recipe.py", | ||
| ], |
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
Summary: The TARGETS file was 0 bytes; BUCK defines the actual neuron_backend cxx_library targeting Android. fbcode now falls through to BUCK with no behavior change. Differential Revision: D109082047
Summary: TARGETS had fbcode-only python_unittest rules; BUCK had xplat fb_native filegroup + define_compute_api_test_targets() call. Combined into a new targets.bzl with if/else split on is_fbcode. Differential Revision: D109082043
Summary: Both files defined the same target names with cell-specific differences (TARGETS: is_fbcode=True for vulkan_spv_shader_lib, no compiler_flags; BUCK: extra arvr opencl + folly:json deps, compiler_flags select). Combined into a new targets.bzl that branches on is_fbcode for the fb_xplat_cxx_binary, with the buck_filegroup and vulkan_spv_shader_lib shared. Differential Revision: D109082051
Summary:
The dir's PACKAGE file uses ci.buckconfig("executorch.event_tracer_enabled")
which is not on xplat's buckconfig allowlist. Wrapped the ci.package call
in `is_fbcode() else None` so xplat skips it (the dir is fbcode-only
anyway since it was TARGETS-only pre-migration).
Then applied the standard chunk-6 transform: created targets.bzl with
define_common_targets(is_fbcode = False) early-returning outside fbcode,
replaced TARGETS with thin BUCK.
Differential Revision: D109081975
Summary: Pull Request resolved: pytorch#21462 These were created after Claude wrote this stack. Reviewed By: mzlee Differential Revision: D113976390
a488286 to
4d67312
Compare
Summary: Pull Request resolved: pytorch#21462 These were created after Claude wrote this stack. Reviewed By: mzlee Differential Revision: D113976390
4d67312 to
3efefcc
Compare
Summary:
These were created after Claude wrote this stack.
Reviewed By: mzlee
Differential Revision: D113976390