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
5 changes: 4 additions & 1 deletion backends/native/runtime/engine/targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "is_xplat", "runti
# its constraint so builds for other platforms skip them. The CUDA and HIP sets
# also link the x86_64 Linux CPU backend, so their settings require it too, and
# stay compatible_with to match the ggml backend targets they link.
CPU_COMPAT = {"target_compatible_with": ["ovr_config//cpu:x86_64", "ovr_config//os:linux"]}
CPU_COMPAT = {"compatible_with": ["ovr_config//os:linux-x86_64", "ovr_config//os:macos-arm64"]}

# For ggml CPU targets that also run torch, which builds only for Linux.
TORCH_COMPAT = {"target_compatible_with": ["ovr_config//cpu:x86_64", "ovr_config//os:linux"]}
CUDA_COMPAT = {"compatible_with": ["fbsource//xplat/executorch/backends/native/runtime/engine:ggml_cuda_platform"]}
HIP_COMPAT = {"compatible_with": ["fbsource//xplat/executorch/backends/native/runtime/engine:ggml_hip_platform"]}
METAL_COMPAT = {"target_compatible_with": ["ovr_config//cpu:arm64", "ovr_config//os:macos"]}
Expand Down
4 changes: 2 additions & 2 deletions backends/native/test/e2e/BUCK
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target")
load("@fbsource//xplat/executorch/backends/native/runtime/engine:targets.bzl", "CPU_COMPAT")
load("@fbsource//xplat/executorch/backends/native/runtime/engine:targets.bzl", "TORCH_COMPAT")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")

oncall("executorch")
Expand All @@ -23,5 +23,5 @@ fbcode_target(
"//pytorch/vision:torchvision",
"fbsource//third-party/pypi/transformers:transformers",
],
**CPU_COMPAT
**TORCH_COMPAT
)
8 changes: 4 additions & 4 deletions backends/native/test/runtime/ggml/BUCK
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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//tools/target_determinator/macros:ci.bzl", "ci")
load("@fbsource//xplat/executorch/backends/native/runtime/engine:targets.bzl", "CPU_COMPAT", "CUDA_COMPAT", "HIP_COMPAT")
load("@fbsource//xplat/executorch/backends/native/runtime/engine:targets.bzl", "CPU_COMPAT", "CUDA_COMPAT", "HIP_COMPAT", "TORCH_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 @@ -28,7 +28,7 @@ fbcode_target(
# runner's --device, link deps and test env, the test host, and the CI
# configuration differ.
_VARIANTS = [
{"suffix": "", "engine": "ggml_engine_cpu", "compat": CPU_COMPAT, "device": "cpu"},
{"suffix": "", "engine": "ggml_engine_cpu", "compat": CPU_COMPAT, "torch_compat": TORCH_COMPAT, "device": "cpu"},
{
"suffix": "_cuda",
"engine": "ggml_engine_cuda",
Expand Down Expand Up @@ -115,7 +115,7 @@ _VARIANTS = [
labels = [] if v["suffix"] + name in ("_act_quant", "_no_linear") else ci.labels(ci.map(ci.skip_test())),
test_main = "//executorch/backends/native/test/samples:sample_test_main",
deps = [":ggml_engine_host" + v["suffix"]],
**v.get("compat", {})
**v.get("torch_compat", v.get("compat", {}))
)
for v in _VARIANTS
for name, flags in [
Expand All @@ -141,7 +141,7 @@ _VARIANTS = [
"//pytorch/ao:torchao",
"fbsource//third-party/pypi/transformers:transformers",
],
**v.get("compat", {})
**v.get("torch_compat", v.get("compat", {}))
)
for v in _VARIANTS
]
Loading