Skip to content

migrate runtime/test (with PACKAGE gating) (#21433) - #21433

Merged
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
bigfootjon:export-D109081975
Aug 3, 2026
Merged

migrate runtime/test (with PACKAGE gating) (#21433)#21433
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
bigfootjon:export-D109081975

Conversation

@bigfootjon

@bigfootjon bigfootjon commented Jul 28, 2026

Copy link
Copy Markdown
Member

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.

Reviewed By: ndmitchell

Differential Revision: D109081975

Copilot AI review requested due to automatic review settings July 28, 2026 16:39
@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/21433

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

⏳ No Failures, 51 Pending

As of commit 8e255ac with merge base e3571c2 (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 D109081975.

@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

Migrates a set of Buck build definitions from TARGETS to the standard “chunk-6” layout (targets.bzl + thin BUCK) while gating fbcode-only targets using is_fbcode() to avoid xplat evaluation of fbcode-only rules/macros.

Changes:

  • Introduces targets.bzl files with define_common_targets(is_fbcode=False) and early-return gating for fbcode-only directories.
  • Replaces legacy TARGETS files with thin BUCK files that load() and call define_common_targets(is_fbcode = is_fbcode()).
  • Updates a few existing BUCK files to delegate target definitions to targets.bzl and adds non_fbcode_target(...) wrapping for a Mediatek rule.

Reviewed changes

Copilot reviewed 34 out of 35 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
runtime/test/targets.bzl Adds gated fbcode-only runtime python tests in a shared define_common_targets function.
runtime/test/TARGETS Removes legacy TARGETS definitions for runtime tests.
runtime/test/BUCK Adds thin BUCK to call define_common_targets gated by is_fbcode().
extension/pytree/test/targets.bzl Moves pytree C++/Python tests into gated define_common_targets.
extension/pytree/test/TARGETS Removes legacy TARGETS definitions for pytree tests.
extension/pytree/test/BUCK Adds thin BUCK to call define_common_targets gated by is_fbcode().
examples/models/llama/config/targets.bzl Updates define_common_targets signature to accept is_fbcode and early-return outside fbcode.
examples/models/llama/config/TARGETS Removes legacy TARGETS shim that called define_common_targets().
examples/models/llama/config/BUCK Adds thin BUCK to call define_common_targets gated by is_fbcode().
backends/vulkan/tools/gpuinfo/targets.bzl Consolidates fbcode + xplat gpuinfo targets into define_common_targets with per-environment branches.
backends/vulkan/tools/gpuinfo/TARGETS Removes legacy TARGETS definitions for gpuinfo.
backends/vulkan/tools/gpuinfo/BUCK Converts BUCK into thin wrapper calling define_common_targets.
backends/vulkan/test/targets.bzl Consolidates fbcode python unittests and xplat shader/filegroup targets into a single gated entrypoint.
backends/vulkan/test/TARGETS Removes legacy TARGETS test definitions.
backends/vulkan/test/BUCK Converts BUCK into thin wrapper calling define_common_targets.
backends/mediatek/runtime/BUCK Wraps the Mediatek neuron backend target with non_fbcode_target(...).
backends/cuda/tests/targets.bzl Moves CUDA python tests into gated define_common_targets.
backends/cuda/tests/TARGETS Removes legacy TARGETS definitions for CUDA tests.
backends/cuda/tests/BUCK Adds thin BUCK to call define_common_targets gated by is_fbcode().
backends/cuda/runtime/targets.bzl Moves CUDA runtime libraries and C++ unit tests into gated define_common_targets.
backends/cuda/runtime/TARGETS Removes legacy TARGETS definitions for CUDA runtime.
backends/cuda/runtime/shims/tests/targets.bzl Gates shim tests behind is_fbcode to preserve fbcode-only behavior.
backends/cuda/runtime/shims/tests/TARGETS Removes legacy TARGETS shim that called define_common_targets().
backends/cuda/runtime/shims/tests/BUCK Adds thin BUCK to call define_common_targets gated by is_fbcode().
backends/cuda/runtime/BUCK Adds thin BUCK to call define_common_targets gated by is_fbcode().
backends/apple/coreml/targets.bzl Consolidates fbcode-only Python targets and xplat Apple C++ targets into one gated define_common_targets.
backends/apple/coreml/TARGETS Removes legacy TARGETS definitions for CoreML fbcode-only rules.
backends/apple/coreml/BUCK Converts BUCK into thin wrapper calling define_common_targets.
backends/aoti/tests/targets.bzl Moves AOTI C++ unit tests into gated define_common_targets.
backends/aoti/tests/TARGETS Removes legacy TARGETS definitions for AOTI tests.
backends/aoti/tests/BUCK Adds thin BUCK to call define_common_targets gated by is_fbcode().
backends/aoti/slim/factory/test/targets.bzl Gates SlimTensor factory tests behind is_fbcode to preserve fbcode-only behavior.
backends/aoti/slim/factory/test/TARGETS Removes legacy TARGETS shim that called define_common_targets().
backends/aoti/slim/factory/test/BUCK Adds thin BUCK to call define_common_targets gated by is_fbcode().

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

Comment on lines +1 to +4
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest")
load("@fbcode_macros//build_defs/lib:re_test_utils.bzl", "re_test_utils")
load("@fbcode//tools/build/buck:nvcc_flags.bzl", "get_nvcc_arch_args")
Comment on lines +126 to +140
deps = [
":cuda_platform",
":runtime_shims",
":cuda_allocator",
":cuda_platform",
"//executorch/backends/aoti:aoti_common_slim",
"//executorch/backends/aoti/slim/core:slimtensor",
"//executorch/backends/aoti/slim/factory:empty",
"//executorch/backends/aoti/slim/factory:from_blob",
"//executorch/backends/aoti/slim/factory:from_etensor",
"//executorch/extension/cuda:caller_stream",
"//executorch/extension/tensor:tensor",
"//executorch/runtime/backend:interface",
"//executorch/runtime/core/exec_aten/util:tensor_util",
],
Comment on lines +28 to +36
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 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.

@meta-codesync meta-codesync Bot changed the title migrate runtime/test (with PACKAGE gating) migrate runtime/test (with PACKAGE gating) (#21433) Jul 31, 2026
bigfootjon added a commit to bigfootjon/executorch that referenced this pull request Jul 31, 2026
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.

Reviewed By: ndmitchell

Differential Revision: D109081975
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
Summary:
Pull Request resolved: pytorch#21433

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.

Reviewed By: ndmitchell

Differential Revision: D109081975

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

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

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

Copilot AI review requested due to automatic review settings August 3, 2026 16:10
bigfootjon added a commit to bigfootjon/executorch that referenced this pull request Aug 3, 2026
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.

Reviewed By: ndmitchell

Differential Revision: D109081975
Summary:
Pull Request resolved: pytorch#21433

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.

Reviewed By: ndmitchell

Differential Revision: D109081975

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

@meta-codesync
meta-codesync Bot merged commit e8feb9e into pytorch:main Aug 3, 2026
183 of 185 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants