Skip to content
Open
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
8 changes: 8 additions & 0 deletions extension/llm/batching/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 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()
54 changes: 54 additions & 0 deletions extension/llm/batching/targets.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")

def define_common_targets():
"""Mirrors the extension_llm_batching CMake targets.

`batching` is the scheduler, the executor seam and the runner, free of
ExecuTorch runtime types. `module_executor` implements the seam against a
program and a KV cache.
"""
runtime.cxx_library(
name = "batching",
srcs = [
"metrics.cpp",
"runner.cpp",
],
exported_headers = [
"decode_first_scheduler.h",
"executor.h",
"metrics.h",
"prefix_cache.h",
"runner.h",
"scheduler.h",
"types.h",
],
visibility = ["PUBLIC"],
exported_deps = [
"//executorch/runtime/platform:compiler",
],
)

runtime.cxx_library(
name = "module_executor",
srcs = [
"module_executor.cpp",
],
exported_headers = [
"module_executor.h",
],
visibility = ["PUBLIC"],
exported_deps = [
":batching",
"//executorch/extension/llm/cache:kv_cache",
"//executorch/extension/llm/runner:stats",
"//executorch/extension/module:module",
"//executorch/runtime/core:core",
],
deps = [
"//executorch/extension/llm/sampler:sampler",
"//executorch/extension/tensor:tensor",
"//executorch/runtime/backend:interface",
"//executorch/runtime/core/exec_aten/util:scalar_type_util",
"//executorch/runtime/platform:platform",
],
)
8 changes: 8 additions & 0 deletions extension/llm/batching/test/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 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()
18 changes: 18 additions & 0 deletions extension/llm/batching/test/targets.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")

def define_common_targets():
"""Mirrors extension_llm_batching_test in CMakeLists.txt."""
runtime.cxx_test(
name = "test",
srcs = [
"prefix_cache_test.cpp",
"runner_test.cpp",
"scheduler_test.cpp",
],
headers = [
"fake_executor.h",
],
deps = [
"//executorch/extension/llm/batching:batching",
],
)
Loading