Skip to content

Commit 64ff228

Browse files
Lunwen Hefacebook-github-bot
authored andcommitted
add the ability to run eager runner via buck
Differential Revision: D64730344
1 parent f044e91 commit 64ff228

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,41 @@
11
# Any targets that should be shared between fbcode and xplat must be defined in
22
# targets.bzl. This file can contain fbcode-only targets.
33

4+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
45
load(":targets.bzl", "define_common_targets")
56

67
oncall("executorch")
78

89
define_common_targets()
10+
11+
runtime.python_library(
12+
name = "eager_runner_library",
13+
srcs = [
14+
"eager.py",
15+
"generation.py"
16+
],
17+
_is_external_target = True,
18+
base_module = "executorch.examples.models.llama.runner",
19+
visibility = [
20+
"//bento/...",
21+
"//bento_kernels/...",
22+
"//executorch/examples/...",
23+
"@EXECUTORCH_CLIENTS",
24+
],
25+
deps = [
26+
"//executorch/examples/models/llama:export_library",
27+
],
28+
)
29+
30+
runtime.python_binary(
31+
name = "eager",
32+
main_function = "executorch.examples.models.llama.runner.eager.main",
33+
preload_deps = [
34+
"//executorch/extension/llm/custom_ops:custom_ops_aot_lib",
35+
"//executorch/kernels/quantized:aot_lib",
36+
],
37+
deps = [
38+
":eager_runner_library",
39+
"//caffe2:torch",
40+
],
41+
)

examples/models/llama/runner/eager.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99
from typing import Optional
1010

1111
import torch
12-
13-
from examples.models.llama.llama_transformer import ModelArgs
1412
from executorch.examples.models.llama.export_llama_lib import (
1513
_prepare_for_llama_export,
1614
build_args_parser as _build_args_parser,
1715
)
16+
from executorch.examples.models.llama.llama_transformer import ModelArgs
1817
from executorch.examples.models.llama.runner.generation import LlamaRunner
19-
from executorch.extension.llm.export import LLMEdgeManager
18+
from executorch.extension.llm.export.builder import LLMEdgeManager
2019

2120

2221
class EagerLlamaRunner(LlamaRunner):

0 commit comments

Comments
 (0)