Skip to content
Merged
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
7 changes: 7 additions & 0 deletions backends/native/examples/hf_llm/runtime/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
load("@fbsource//third-party/llama.cpp:ggml_ci.bzl", "ggml_ci_labels")
load("@fbsource//tools/build_defs:default_platform_defs.bzl", "CXX")
load("@fbsource//xplat/executorch/backends/native/runtime/engine:targets.bzl", "CPU_COMPAT", "CUDA_COMPAT", "HIP_COMPAT", "METAL_COMPAT")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")

Expand Down Expand Up @@ -80,6 +82,7 @@ fbcode_target(
# ggml's VMM pool calls the driver API, which //third-party/cuda:libcuda does not link on fbcode.
("cuda", None, "cuda_driver_api-lazy"),
],
labels = ggml_ci_labels("cuda"),
visibility = ["PUBLIC"],
**CUDA_COMPAT
)
Expand All @@ -93,6 +96,7 @@ fbcode_target(
"//executorch/backends/native/runtime/engine:ggml_engine_hip",
],
external_deps = ["gflags"],
labels = ggml_ci_labels("hip"),
visibility = ["PUBLIC"],
**HIP_COMPAT
)
Expand All @@ -108,6 +112,9 @@ non_fbcode_target(
"//executorch/backends/native/runtime/engine:ggml_engine_metal",
],
external_deps = ["gflags"],
labels = ggml_ci_labels("metal"),
# ggml-metal has no mobile flavors.
platforms = [CXX],
visibility = ["PUBLIC"],
**METAL_COMPAT
)
5 changes: 5 additions & 0 deletions backends/native/runtime/engine/targets.bzl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@fbsource//third-party/llama.cpp:ggml_ci.bzl", "ggml_ci_labels")
load("@fbsource//tools/build_defs:default_platform_defs.bzl", "CXX")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "is_xplat", "runtime")

# Platform constraints of the ggml backend sets. Targets that link one repeat
Expand Down Expand Up @@ -81,6 +83,9 @@ def define_common_targets():
"//executorch/backends/native/runtime/graph:value",
ggml_dep,
],
labels = ggml_ci_labels(variant),
# The GPU sets have no mobile flavors.
platforms = None if variant == "cpu" else [CXX],
visibility = ["//executorch/backends/native/..."],
**compat
)
8 changes: 7 additions & 1 deletion backends/native/test/runtime/ggml/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target")
load("@fbsource//third-party/llama.cpp:ggml_ci.bzl", "ggml_ci_labels")
load("@fbsource//xplat/executorch/backends/native/runtime/engine:targets.bzl", "CPU_COMPAT", "CUDA_COMPAT", "HIP_COMPAT")
load("@fbcode_macros//build_defs/lib:re_test_utils.bzl", "re_test_utils")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
Expand All @@ -22,13 +23,15 @@ fbcode_target(
)

# The op suite runs once per ggml backend set; only the engine variant, the
# runner's --device, link deps and resources, and the test host differ.
# runner's --device, link deps and resources, the test host, and the CI
# configuration differ.
_VARIANTS = [
{"suffix": "", "engine": "ggml_engine_cpu", "compat": CPU_COMPAT, "device": "cpu"},
{
"suffix": "_cuda",
"engine": "ggml_engine_cuda",
"compat": CUDA_COMPAT,
"labels": ggml_ci_labels("cuda"),
"device": "gpu",
"remote_execution": re_test_utils.remote_execution(
platform = "gpu-remote-execution",
Expand All @@ -47,6 +50,7 @@ _VARIANTS = [
"suffix": "_hip",
"engine": "ggml_engine_hip",
"compat": HIP_COMPAT,
"labels": ggml_ci_labels("hip"),
"device": "gpu",
"remote_execution": re_test_utils.remote_execution(
platform = "amd-gpu",
Expand All @@ -66,6 +70,7 @@ _VARIANTS = [
"//executorch/backends/native/test/runtime:ptn_runner_main",
] + v.get("deps", []),
external_deps = ["gflags"] + v.get("external_deps", []),
labels = v.get("labels", []),
**v.get("compat", {})
)
for v in _VARIANTS
Expand All @@ -77,6 +82,7 @@ _VARIANTS = [
name = "test_ggml_ops" + v["suffix"],
srcs = ["test_ggml_ops.py"],
env = {"GGML_PTN_DEVICE": v["device"]},
labels = v.get("labels", []),
remote_execution = v.get("remote_execution"),
resources = {":ggml_ptn_runner" + v["suffix"]: "ggml_ptn_runner"} |
v.get("resources", {}),
Expand Down
4 changes: 4 additions & 0 deletions shim_et/third-party/llama.cpp/ggml_ci.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Open-source builds have no Meta CI configuration, so targets that link a ggml
# GPU backend set get no CI labels.
def ggml_ci_labels(_backend):
return []
Loading