Skip to content

Commit 8c0f668

Browse files
bigfootjonmeta-codesync[bot]
authored andcommitted
drop redundant TARGETS files that duplicate sister BUCK files
Summary: Initial chunk of fbcode/executorch TARGETS->BUCK migration. Removes 40 TARGETS files where: - 7 are byte-identical to their sister BUCK file, OR - 33 contain only a no-arg `define_common_targets()` call matching a sister BUCK that also calls `define_common_targets()` with no args In both cases fbcode falls through to the BUCK file (via `name_v2 = TARGETS,BUCK`) and evaluates the exact same content it did before. Any TARGETS that passes any argument to define_common_targets (positional or keyword) is intentionally excluded — those are the `is_fbcode = True` cases that need a separate, more careful treatment. Differential Revision: D109082060
1 parent 6f6225c commit 8c0f668

39 files changed

Lines changed: 120 additions & 287 deletions

File tree

backends/qualcomm/aot/wrappers/TARGETS

Lines changed: 0 additions & 5 deletions
This file was deleted.

backends/qualcomm/builders/TARGETS

Lines changed: 0 additions & 5 deletions
This file was deleted.

codegen/test/TARGETS

Lines changed: 0 additions & 8 deletions
This file was deleted.

configurations/TARGETS

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/devtools/example_runner/TARGETS

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/models/gemma4/BUCK

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,128 @@
11
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
2+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
23
load(":targets.bzl", "define_common_targets")
34

45
oncall("executorch")
56

67
non_fbcode_target(_kind = define_common_targets,)
78

89
fbcode_target(_kind = define_common_targets,)
10+
11+
# Text decoder module
12+
fbcode_target(_kind = runtime.python_library,
13+
name = "text_decoder",
14+
srcs = [
15+
"text_decoder/__init__.py",
16+
"text_decoder/convert_weights.py",
17+
"text_decoder/gemma4_attention.py",
18+
"text_decoder/gemma4_config.py",
19+
"text_decoder/gemma4_cross_decoder.py",
20+
"text_decoder/gemma4_decoder_layer.py",
21+
"text_decoder/gemma4_model.py",
22+
"text_decoder/gemma4_self_decoder.py",
23+
"text_decoder/gemma4_transformer.py",
24+
],
25+
_is_external_target = True,
26+
base_module = "executorch.examples.models.gemma4",
27+
resources = {
28+
"config/e2b_config.json": "config/e2b_config.json",
29+
"config/e4b_config.json": "config/e4b_config.json",
30+
},
31+
deps = [
32+
"//caffe2:torch",
33+
"fbsource//third-party/pypi/safetensors:safetensors",
34+
"fbsource//third-party/pypi/transformers:transformers",
35+
],
36+
visibility = ["PUBLIC"],
37+
)
38+
39+
# Speech transform module
40+
fbcode_target(_kind = runtime.python_library,
41+
name = "speech_transform",
42+
srcs = [
43+
"speech_transform.py",
44+
],
45+
_is_external_target = True,
46+
base_module = "executorch.examples.models.gemma4",
47+
deps = [
48+
"//caffe2:torch",
49+
],
50+
visibility = ["PUBLIC"],
51+
)
52+
53+
# Export utilities (shared quantization code)
54+
fbcode_target(_kind = runtime.python_library,
55+
name = "quant_utils",
56+
srcs = ["quant_utils.py"],
57+
_is_external_target = True,
58+
base_module = "executorch.examples.models.gemma4",
59+
deps = [
60+
"//caffe2:torch",
61+
"//executorch/examples/models/llama:source_transformation",
62+
"//executorch/extension/llm/export:export_lib",
63+
"//pytorch/ao:torchao",
64+
],
65+
visibility = ["PUBLIC"],
66+
)
67+
68+
# Single PTE export
69+
fbcode_target(_kind = runtime.python_binary,
70+
name = "export_gemma4",
71+
srcs = ["export_gemma4.py"],
72+
main_function = "executorch.examples.models.gemma4.export_gemma4.main",
73+
preload_deps = [
74+
"//pytorch/ao/torchao/csrc/cpu/shared_kernels/linear_8bit_act_xbit_weight:op_linear_8bit_act_xbit_weight_aten",
75+
"//pytorch/ao/torchao/csrc/cpu/shared_kernels/embedding_xbit:op_embedding_xbit_aten",
76+
"//executorch/extension/llm/custom_ops:custom_ops_aot_lib",
77+
"//executorch/kernels/quantized:aot_lib",
78+
],
79+
deps = [
80+
":text_decoder",
81+
":speech_transform",
82+
":quant_utils",
83+
"//caffe2:torch",
84+
"//executorch/exir:lib",
85+
"//executorch/backends/xnnpack/partition:xnnpack_partitioner",
86+
"//executorch/backends/xnnpack/quantizer:xnnpack_quantizer",
87+
"//executorch/extension/llm/export:export_lib",
88+
"//executorch/extension/llm/custom_ops:custom_ops_aot_lib",
89+
"//executorch/extension/llm/custom_ops:custom_ops_aot_py",
90+
"//executorch/kernels/quantized:aot_lib",
91+
"//pytorch/ao:torchao",
92+
"fbsource//third-party/pypi/safetensors:safetensors",
93+
"fbsource//third-party/pypi/transformers:transformers",
94+
],
95+
)
96+
97+
# Image preprocessing utilities
98+
fbcode_target(_kind = runtime.python_library,
99+
name = "image_utils",
100+
srcs = ["image_utils.py"],
101+
_is_external_target = True,
102+
base_module = "executorch.examples.models.gemma4",
103+
deps = [
104+
"//caffe2:torch",
105+
"fbsource//third-party/pypi/pillow:pillow",
106+
],
107+
visibility = ["PUBLIC"],
108+
)
109+
110+
# Python runner (single PTE, audio + vision + text-only)
111+
fbcode_target(_kind = runtime.python_binary,
112+
name = "run_gemma4",
113+
srcs = ["run_gemma4.py"],
114+
main_function = "executorch.examples.models.gemma4.run_gemma4.main",
115+
preload_deps = [
116+
"//executorch/backends/xnnpack:xnnpack_backend",
117+
"//executorch/extension/llm/custom_ops:custom_ops_aot_lib",
118+
"//executorch/kernels/quantized:aot_lib",
119+
"//pytorch/ao/torchao/csrc/cpu/shared_kernels/embedding_xbit:op_embedding_xbit_aten",
120+
"//pytorch/ao/torchao/csrc/cpu/shared_kernels/linear_8bit_act_xbit_weight:op_linear_8bit_act_xbit_weight_aten",
121+
],
122+
deps = [
123+
":image_utils",
124+
"//caffe2:torch",
125+
"//executorch/runtime:runtime",
126+
"fbsource//third-party/pypi/sentencepiece:sentencepiece",
127+
],
128+
)

examples/qualcomm/executor_runner/TARGETS

Lines changed: 0 additions & 8 deletions
This file was deleted.

extension/aten_util/TARGETS

Lines changed: 0 additions & 8 deletions
This file was deleted.

extension/aten_util/test/TARGETS

Lines changed: 0 additions & 8 deletions
This file was deleted.

extension/cuda/TARGETS

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)