Skip to content

migrate backends/vulkan/test (fbcode python_unittest + xplat fb_native) (#21431) - #21431

Merged
meta-codesync[bot] merged 3 commits into
pytorch:mainfrom
bigfootjon:export-D109082043
Jul 31, 2026
Merged

migrate backends/vulkan/test (fbcode python_unittest + xplat fb_native) (#21431)#21431
meta-codesync[bot] merged 3 commits into
pytorch:mainfrom
bigfootjon:export-D109082043

Conversation

@bigfootjon

@bigfootjon bigfootjon commented Jul 28, 2026

Copy link
Copy Markdown
Member

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.

Reviewed By: ndmitchell

Differential Revision: D109082043

Copilot AI review requested due to automatic review settings July 28, 2026 16:16
@pytorch-bot pytorch-bot Bot added the module: vulkan Issues related to the Vulkan delegate and code under backends/vulkan/ label Jul 28, 2026
@pytorch-bot

pytorch-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21431

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 9f85d03 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 28, 2026
@meta-codesync

meta-codesync Bot commented Jul 28, 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 D109082043.

@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 migrates several directories from fbcode-only TARGETS build files (and mixed TARGETS/BUCK setups) to a unified BUCK + targets.bzl pattern, using is_fbcode() to preserve the prior fbcode-vs-xplat behavior split. This aligns these test/build target definitions with the broader build-file migration approach used across the repo.

Changes:

  • Introduce new targets.bzl entrypoints that encapsulate fbcode vs xplat target definitions behind define_common_targets(is_fbcode=...).
  • Replace/retire TARGETS files in multiple locations, adding (or updating) BUCK files to call define_common_targets(...).
  • Wrap a MediaTek runtime library target with non_fbcode_target(...) to keep it non-fbcode-only during migration.

Reviewed changes

Copilot reviewed 28 out of 29 changed files in this pull request and generated no comments.

Show a summary per file
File Description
extension/pytree/test/targets.bzl New shared target definitions (fbcode-only tests gated via is_fbcode).
extension/pytree/test/TARGETS Removed legacy fbcode TARGETS definitions.
extension/pytree/test/BUCK New BUCK entrypoint calling define_common_targets(is_fbcode = is_fbcode()).
examples/models/llama/config/targets.bzl Gate fbcode-only python_unittest usage behind is_fbcode parameter.
examples/models/llama/config/TARGETS Removed legacy TARGETS wrapper that invoked define_common_targets().
examples/models/llama/config/BUCK New BUCK entrypoint calling define_common_targets(is_fbcode = is_fbcode()).
backends/vulkan/test/targets.bzl Consolidates fbcode Python unittests and xplat shader/filegroup + compute-api test targets into one define_common_targets.
backends/vulkan/test/TARGETS Removed legacy fbcode TARGETS test definitions.
backends/vulkan/test/BUCK Switched to calling define_common_targets(is_fbcode = is_fbcode()) rather than defining xplat targets directly.
backends/mediatek/runtime/BUCK Wraps the neuron_backend runtime.cxx_library with non_fbcode_target(...).
backends/cuda/tests/targets.bzl New fbcode-gated CUDA test targets moved from TARGETS.
backends/cuda/tests/TARGETS Removed legacy TARGETS definitions for CUDA tests.
backends/cuda/tests/BUCK New BUCK entrypoint calling define_common_targets(is_fbcode = is_fbcode()).
backends/cuda/runtime/targets.bzl New fbcode-gated CUDA runtime + C++ unit tests moved from TARGETS.
backends/cuda/runtime/TARGETS Removed legacy TARGETS definitions for CUDA runtime/test targets.
backends/cuda/runtime/shims/tests/targets.bzl Updates define_common_targets to accept is_fbcode and early-return outside fbcode.
backends/cuda/runtime/shims/tests/TARGETS Removed legacy TARGETS wrapper invoking define_common_targets().
backends/cuda/runtime/shims/tests/BUCK New BUCK entrypoint calling define_common_targets(is_fbcode = is_fbcode()).
backends/cuda/runtime/BUCK New BUCK entrypoint calling define_common_targets(is_fbcode = is_fbcode()).
backends/apple/coreml/targets.bzl New combined fbcode + xplat target definitions, preserving the prior split via is_fbcode.
backends/apple/coreml/TARGETS Removed legacy fbcode TARGETS definitions.
backends/apple/coreml/BUCK Reduced to a dispatcher that calls define_common_targets(is_fbcode = is_fbcode()).
backends/aoti/tests/targets.bzl New fbcode-gated AOTI test targets moved from TARGETS.
backends/aoti/tests/TARGETS Removed legacy TARGETS definitions for AOTI tests.
backends/aoti/tests/BUCK New BUCK entrypoint calling define_common_targets(is_fbcode = is_fbcode()).
backends/aoti/slim/factory/test/targets.bzl Gates prior fbcode-only test definitions via is_fbcode param + early return.
backends/aoti/slim/factory/test/TARGETS Removed legacy TARGETS wrapper invoking define_common_targets().
backends/aoti/slim/factory/test/BUCK New BUCK entrypoint calling define_common_targets(is_fbcode = is_fbcode()).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ndmitchell ndmitchell left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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
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
@meta-codesync meta-codesync Bot changed the title migrate backends/vulkan/test (fbcode python_unittest + xplat fb_native) migrate backends/vulkan/test (fbcode python_unittest + xplat fb_native) (#21431) Jul 31, 2026
bigfootjon added a commit to bigfootjon/executorch that referenced this pull request Jul 31, 2026
…e) (pytorch#21431)

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.

Reviewed By: ndmitchell

Differential Revision: D109082043
Copilot AI review requested due to automatic review settings July 31, 2026 15:47
bigfootjon added a commit to bigfootjon/executorch that referenced this pull request Jul 31, 2026
…e) (pytorch#21431)

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.

Reviewed By: ndmitchell

Differential Revision: D109082043
…e) (pytorch#21431)

Summary:
Pull Request resolved: pytorch#21431

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.

Reviewed By: ndmitchell

Differential Revision: D109082043
bigfootjon added a commit to bigfootjon/executorch that referenced this pull request Jul 31, 2026
…e) (pytorch#21431)

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.

Reviewed By: ndmitchell

Differential Revision: D109082043

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 7 out of 8 changed files in this pull request and generated no new comments.

Suppressed comments (1)

backends/apple/coreml/BUCK:9

  • The PR title/description describe migrating only backends/vulkan/test, but this PR also changes build files under backends/apple/coreml (and backends/mediatek/runtime). This makes the PR metadata misleading for reviewers and release notes; please either update the title/description to include the additional migrations or split the unrelated migrations into separate PRs.
# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl.

load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode")
load(":targets.bzl", "define_common_targets")

oncall("executorch")

define_common_targets(is_fbcode = is_fbcode())

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

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 7 out of 8 changed files in this pull request and generated no new comments.

@meta-codesync
meta-codesync Bot merged commit 644990e into pytorch:main Jul 31, 2026
201 of 202 checks passed
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 module: vulkan Issues related to the Vulkan delegate and code under backends/vulkan/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants