Skip to content

Clean up remaining TARGETS files (#21462) - #21462

Open
bigfootjon wants to merge 6 commits into
pytorch:mainfrom
bigfootjon:export-D113976390
Open

Clean up remaining TARGETS files (#21462)#21462
bigfootjon wants to merge 6 commits into
pytorch:mainfrom
bigfootjon:export-D113976390

Conversation

@bigfootjon

@bigfootjon bigfootjon commented Jul 29, 2026

Copy link
Copy Markdown
Member

Summary:

These were created after Claude wrote this stack.

Reviewed By: mzlee

Differential Revision: D113976390

Copilot AI review requested due to automatic review settings July 29, 2026 15:31
@pytorch-bot

pytorch-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

🔗 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 Pending

As of commit 3efefcc with merge base d8c6be2 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 29, 2026
@meta-codesync

meta-codesync Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@bigfootjon has exported this pull request. If you are a Meta employee, you can view the originating Diff in D113976390.

@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TARGETS files with BUCK wrappers that call define_common_targets(...) from targets.bzl.
  • Added new targets.bzl files 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_library also sets base_module = "executorch.examples.models.gemma4_31b" but doesn’t include __init__.py in srcs, 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.

Comment on lines +8 to +12
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
bigfootjon added a commit to bigfootjon/executorch that referenced this pull request Jul 31, 2026
Summary:
Pull Request resolved: pytorch#21462

These were created after Claude wrote this stack.

Reviewed By: mzlee

Differential Revision: D113976390
@meta-codesync meta-codesync Bot changed the title Clean up remaining TARGETS files Clean up remaining TARGETS files (#21462) Jul 31, 2026
Copilot AI review requested due to automatic review settings July 31, 2026 15:51
Summary:
Pull Request resolved: pytorch#21462

These were created after Claude wrote this stack.

Reviewed By: mzlee

Differential Revision: D113976390

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 31, 2026 15:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants