migrate examples/models/llama/config (fbcode-only python_unittest) - #21428
Conversation
Summary: Chunk 11 of fbcode/executorch TARGETS->BUCK migration. 5 directories that had only a TARGETS file with substantive fbcode-only content but were skipped from earlier chunks for various reasons (`fbcode_target(`, `fbcode_macros`, fbcode-only kwargs, etc.). Same chunk-6 pattern: created `targets.bzl` with `define_common_targets(is_fbcode = False)` whose body opens with `if not is_fbcode: return`, replaced TARGETS with a thin BUCK calling `define_common_targets(is_fbcode = is_fbcode())`. Directories migrated: - backends/aoti/tests - backends/cuda/runtime - backends/cuda/tests - extension/pybindings/fb - extension/pytree/test Differential Revision: D109082053
Summary: Add is_fbcode param to define_common_targets and early-return outside fbcode. The cxx_test rules use fbcode-only kwargs (keep_gpu_sections, re_test_utils.remote_execution) and were never evaluated in xplat (TARGETS-only pre-migration). Replaced TARGETS with thin BUCK calling define_common_targets(is_fbcode = is_fbcode()). Differential Revision: D109082041
Summary: Add is_fbcode early-return to existing define_common_targets. The cpp_unittest rules use fbcode-only kwargs (keep_gpu_sections, re_test_utils.remote_execution) and can't run in xplat. Replaced TARGETS with thin BUCK. Differential Revision: D109082049
Summary: Add is_fbcode early-return; replace TARGETS with thin BUCK. Differential Revision: D109082042
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21428
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New FailuresAs of commit ee91e7d with merge base c7b6f52 ( NEW FAILURES - The following jobs have failed:
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 D109082042. |
This PR needs a
|
There was a problem hiding this comment.
Pull request overview
This PR migrates several fbcode Buck target definitions from legacy TARGETS files into thin BUCK entrypoints that delegate to targets.bzl, adding an is_fbcode gate to preserve prior behavior when these definitions are evaluated outside fbcode.
Changes:
- Replace multiple
TARGETSfiles withBUCKfiles that calldefine_common_targets(is_fbcode = is_fbcode()). - Introduce new
targets.bzlfiles (or update existing ones) to host the shared target definitions. - Add early-return gating in
define_common_targetsto avoid defining fbcode-only targets when not in fbcode.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| extension/pytree/test/targets.bzl | New define_common_targets(is_fbcode=...) with fbcode-gated C++/Python unittests. |
| extension/pytree/test/TARGETS | Removed legacy TARGETS definition in favor of BUCK indirection. |
| extension/pytree/test/BUCK | New thin BUCK that calls into targets.bzl with is_fbcode(). |
| examples/models/llama/config/targets.bzl | Gate python_unittest target definition behind is_fbcode. |
| examples/models/llama/config/TARGETS | Removed legacy TARGETS entrypoint. |
| examples/models/llama/config/BUCK | New BUCK entrypoint calling define_common_targets(is_fbcode = is_fbcode()). |
| backends/cuda/tests/targets.bzl | New fbcode-gated Python unittest targets for CUDA backend tests. |
| backends/cuda/tests/TARGETS | Removed legacy TARGETS definitions. |
| backends/cuda/tests/BUCK | New BUCK entrypoint calling into targets.bzl. |
| backends/cuda/runtime/targets.bzl | New fbcode-gated runtime libraries and CUDA C++ unittests migrated from TARGETS. |
| backends/cuda/runtime/TARGETS | Removed legacy TARGETS definitions. |
| backends/cuda/runtime/shims/tests/targets.bzl | Add is_fbcode gating to preserve pre-migration behavior for shim tests. |
| backends/cuda/runtime/shims/tests/TARGETS | Removed legacy TARGETS entrypoint. |
| backends/cuda/runtime/shims/tests/BUCK | New BUCK entrypoint calling into targets.bzl. |
| backends/cuda/runtime/BUCK | New BUCK entrypoint calling into targets.bzl. |
| backends/aoti/tests/targets.bzl | New fbcode-gated AOTI C++ unittest targets migrated from TARGETS. |
| backends/aoti/tests/TARGETS | Removed legacy TARGETS definitions. |
| backends/aoti/tests/BUCK | New BUCK entrypoint calling into targets.bzl. |
| backends/aoti/slim/factory/test/targets.bzl | Add is_fbcode gating around existing SlimTensor factory tests. |
| backends/aoti/slim/factory/test/TARGETS | Removed legacy TARGETS entrypoint. |
| backends/aoti/slim/factory/test/BUCK | New BUCK entrypoint calling into targets.bzl. |
💡 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:python_unittest.bzl", "python_unittest") | ||
| load("@fbcode_macros//build_defs:python_unittest_remote_gpu.bzl", "python_unittest_remote_gpu") | ||
| load("@fbcode_macros//build_defs/lib:re_test_utils.bzl", "re_test_utils") |
| deps = [ | ||
| ":cuda_platform", | ||
| ":runtime_shims", | ||
| ":cuda_allocator", | ||
| ":cuda_platform", |
| "//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: Add is_fbcode early-return; replace TARGETS with thin BUCK.
Differential Revision: D109082042