Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions examples/models/smollm2/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")

oncall("executorch")

fbcode_target(_kind = runtime.python_library,
name = "smollm2",
srcs = [
"__init__.py",
"convert_weights.py",
],
_is_external_target = True,
base_module = "executorch.examples.models.smollm2",
resources = {
"135M_config.json": "135M_config.json",
},
deps = [
"//caffe2:torch",
"//executorch/examples/models:model_base",
"//executorch/examples/models/llama:llama2_model",
"fbcode//pytorch/torchtune:lib",
],
visibility = ["PUBLIC"],
)
25 changes: 25 additions & 0 deletions examples/models/smollm3/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")

oncall("executorch")

fbcode_target(_kind = runtime.python_library,
name = "smollm3",
srcs = [
"__init__.py",
"convert_weights.py",
],
_is_external_target = True,
base_module = "executorch.examples.models.smollm3",
resources = {
"3b_config.json": "3b_config.json",
},
deps = [
"//caffe2:torch",
"//executorch/examples/models:model_base",
"//executorch/examples/models/llama:llama2_model",
"fbcode//pytorch/torchtune:lib",
],
visibility = ["PUBLIC"],
)
17 changes: 17 additions & 0 deletions examples/models/torchvision_vit/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")

oncall("executorch")

fbcode_target(_kind = python_library,
name = "vit_model",
srcs = [
"__init__.py",
"model.py",
],
deps = [
"//caffe2:torch",
"//executorch/examples/models:model_base",
"//pytorch/vision:torchvision", # @manual
],
)
17 changes: 17 additions & 0 deletions examples/models/toy_model/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")

oncall("executorch")

fbcode_target(_kind = python_library,
name = "toy_model",
srcs = [
"__init__.py",
"model.py",
],
deps = [
"//caffe2:torch",
"//executorch/examples/models:model_base",
"//executorch/exir/backend:compile_spec_schema",
],
)
17 changes: 17 additions & 0 deletions examples/models/wav2letter/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")

oncall("executorch")

fbcode_target(_kind = python_library,
name = "w2l_model",
srcs = [
"__init__.py",
"model.py",
],
deps = [
"//caffe2:torch",
"//executorch/examples/models:model_base",
"//pytorch/audio/src:torchaudio_core",
],
)
15 changes: 13 additions & 2 deletions examples/portable/custom_ops/BUCK
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
oncall("executorch")
# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl. This file can contain xplat-only targets.

load(":targets.bzl", "define_common_targets")

oncall("executorch")

define_common_targets()
non_fbcode_target(_kind = define_common_targets,)

# !!!! fbcode/executorch/examples/portable/custom_ops/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!!

# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl. This file can contain fbcode-only targets.

load(":targets.bzl", "define_common_targets")


fbcode_target(_kind = define_common_targets,)
15 changes: 13 additions & 2 deletions examples/portable/executor_runner/BUCK
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
oncall("executorch")
# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl. This file can contain xplat-only targets.

load(":targets.bzl", "define_common_targets")

oncall("executorch")

define_common_targets()
non_fbcode_target(_kind = define_common_targets,)

# !!!! fbcode/executorch/examples/portable/executor_runner/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!!

# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl. This file can contain fbcode-only targets.

load(":targets.bzl", "define_common_targets")


fbcode_target(_kind = define_common_targets,)
8 changes: 0 additions & 8 deletions examples/portable/executor_runner/TARGETS

This file was deleted.

20 changes: 20 additions & 0 deletions examples/portable/scripts/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")

oncall("executorch")

fbcode_target(_kind = runtime.python_binary,
name = "export",
srcs = [
"export.py",
],
main_function = "executorch.examples.portable.scripts.export.main",
resources = {
"//executorch/examples/models/llama/params:params": "params",
},
visibility = ["//executorch/..."],
deps = [
"//executorch/examples/models:models",
"//executorch/extension/export_util:export_util",
],
)
7 changes: 4 additions & 3 deletions examples/qualcomm/TARGETS → examples/qualcomm/BUCK
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl. This file can contain fbcode-only targets.

Expand All @@ -8,7 +9,7 @@ load("@fbsource//xplat/executorch/backends/qualcomm/qnn_version.bzl", "get_qnn_l

oncall("executorch")

python_binary(
fbcode_target(_kind = python_binary,
name = "export_example",
srcs = ["scripts/export_example.py"],
main_function = ".scripts.export_example.main",
Expand All @@ -24,7 +25,7 @@ python_binary(
],
)

runtime.command_alias(
fbcode_target(_kind = runtime.command_alias,
name = "export_example_qnn",
env = {
"LD_LIBRARY_PATH": "$(location fbsource//third-party/qualcomm/qnn/qnn-{0}:qnn_offline_compile_libs)".format(get_qnn_library_version()),
Expand All @@ -33,7 +34,7 @@ runtime.command_alias(
exe = ":export_example",
)

runtime.python_library(
fbcode_target(_kind = runtime.python_library,
name = "utils",
srcs = ["utils.py"],
deps = [
Expand Down
15 changes: 13 additions & 2 deletions examples/qualcomm/executor_runner/BUCK
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
oncall("executorch")
# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl. This file can contain xplat-only targets.

load(":targets.bzl", "define_common_targets")


non_fbcode_target(_kind = define_common_targets,)

# !!!! fbcode/executorch/examples/qualcomm/executor_runner/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!!

# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl. This file can contain xplat-only targets.

load(":targets.bzl", "define_common_targets")

oncall("executorch")

define_common_targets()
fbcode_target(_kind = define_common_targets,)
8 changes: 0 additions & 8 deletions examples/qualcomm/executor_runner/TARGETS

This file was deleted.

128 changes: 126 additions & 2 deletions examples/qualcomm/oss_scripts/llama/BUCK
Original file line number Diff line number Diff line change
@@ -1,8 +1,132 @@
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
oncall("executorch")
# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl. This file can contain xplat-only targets.

load(":targets.bzl", "define_common_targets")

oncall("executorch")

define_common_targets()
non_fbcode_target(_kind = define_common_targets,)

# !!!! fbcode/executorch/examples/qualcomm/oss_scripts/llama/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!!

load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
load("@fbsource//xplat/executorch/backends/qualcomm/qnn_version.bzl", "get_qnn_library_version")
load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")


fbcode_target(_kind = runtime.python_library,
name = "static_llama",
srcs = [
"model/__init__.py",
"model/apply_rope.py",
"model/feed_forward.py",
"model/layernorm.py",
"model/static_llama.py",
],
deps = [
"//caffe2:torch",
"//executorch/examples/models/llama:transformer_modules",
"fbsource//third-party/pypi/transformers:transformers",
],
)

fbcode_target(_kind = runtime.python_library,
name = "decoder_utils",
srcs = [
"decoder_utils.py",
],
deps = [
"//caffe2:torch",
"//executorch/examples/models/llama:eval_library",
],
)

fbcode_target(_kind = runtime.python_library,
name = "masking_utils",
srcs = [
"masking_utils.py",
],
deps = [
"//caffe2:torch",
],
)

fbcode_target(_kind = runtime.python_library,
name = "decoder_constants",
srcs = [
"decoder_constants.py",
],
)

fbcode_target(_kind = runtime.python_library,
name = "llama_lib",
srcs = ["__init__.py", "llama.py"],
deps = [
":decoder_constants",
":decoder_utils",
":masking_utils",
"//executorch/examples/models/llama:source_transformation",
"//caffe2:torch",
"//executorch/backends/qualcomm/partition:partition",
"//executorch/backends/qualcomm/quantizer:quantizer",
"//executorch/devtools/backend_debug:delegation_info",
"//executorch/devtools:lib",
"//executorch/examples/models:models",
"//executorch/examples/models/llama:hf_download",
"//executorch/examples/qualcomm/oss_scripts/llama:range_setting_pt2e",
"//executorch/examples/qualcomm/oss_scripts/llama:static_llama",
"//executorch/examples/qualcomm:utils",
"//executorch/extension/export_util:export_util",
"//executorch/extension/llm/export:export_lib",
"//executorch/extension/pybindings:aten_lib",
],
)

fbcode_target(_kind = runtime.python_library,
name = "range_setting_pt2e",
srcs = [
"range_setting_pt2e.py",
],
deps = [
"//caffe2:torch",
],
)

fbcode_target(_kind = python_binary,
name = "llama",
main_function = "executorch.examples.qualcomm.oss_scripts.llama.llama.main",
preload_deps = [
"//executorch/extension/llm/custom_ops:model_sharding_py",
],
deps = [
":llama_lib",
],
)

fbcode_target(_kind = python_binary,
name = "eval_llama_qnn",
srcs = ["eval_llama_qnn.py"],
main_function = "executorch.examples.qualcomm.oss_scripts.llama.eval_llama_qnn.main",
preload_deps = [
"//executorch/extension/llm/custom_ops:model_sharding_py",
],
deps = [
":llama_lib",
"//executorch/examples/models/llama:eval_library",
"//executorch/examples/qualcomm/oss_scripts/llama:range_setting_pt2e",
"fbsource//third-party/pypi/lm-eval:lm-eval",
],
keep_gpu_sections = True,
)

fbcode_target(_kind = runtime.command_alias,
name = "llama_qnn",
env = {
"LD_LIBRARY_PATH": "$(location fbsource//third-party/qualcomm/qnn/qnn-{0}:qnn_offline_compile_libs)".format(get_qnn_library_version()),
# Place holder to pass the QNN_SDK_ROOT check in executorch/examples/qualcomm/utils.py
"QNN_SDK_ROOT": "",
},
exe = ":llama",
)
Loading
Loading