migrate runtime/test (with PACKAGE gating) (#21433) - #21433
Conversation
🔗 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 PendingAs of commit 8e255ac with merge base e3571c2 ( 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 D109081975. |
This PR needs a
|
There was a problem hiding this comment.
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.bzlfiles withdefine_common_targets(is_fbcode=False)and early-return gating for fbcode-only directories. - Replaces legacy
TARGETSfiles with thinBUCKfiles thatload()and calldefine_common_targets(is_fbcode = is_fbcode()). - Updates a few existing
BUCKfiles to delegate target definitions totargets.bzland addsnon_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.
| 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") |
| 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", | ||
| ], |
| 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
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
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
21ef68d to
7f800ca
Compare
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
7f800ca to
9d4bd23
Compare
9d4bd23 to
d4c5183
Compare
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
d4c5183 to
8e255ac
Compare
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 Noneso xplat skips it (the dir is fbcode-onlyanyway 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