Skip to content

Commit 76825e3

Browse files
jackzhxngfacebook-github-bot
authored andcommitted
Buckify Llama multimodal export
Summary: Buckify export path for Llama multimodal Reviewed By: iseeyuan Differential Revision: D67949092
1 parent 9666ee8 commit 76825e3

File tree

6 files changed

+108
-0
lines changed

6 files changed

+108
-0
lines changed

examples/models/llama/TARGETS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ runtime.python_library(
107107
"//ai_codesign/gen_ai/fast_hadamard_transform:fast_hadamard_transform",
108108
"//caffe2:torch",
109109
"//executorch/backends/vulkan/_passes:vulkan_passes",
110+
"//executorch/exir/passes:init_mutable_pass",
110111
"//executorch/examples/models:model_base",
111112
"//executorch/examples/models:models",
112113
"//executorch/extension/llm/custom_ops:custom_ops_aot_py",
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
2+
3+
oncall("executorch")
4+
5+
python_library(
6+
name = "multimodal_lib",
7+
srcs = [
8+
"__init__.py",
9+
],
10+
deps = [
11+
"//executorch/examples/models/llama3_2_vision/text_decoder:model",
12+
"//executorch/examples/models/llama3_2_vision/vision_encoder:model",
13+
],
14+
)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
2+
3+
oncall("executorch")
4+
5+
python_library(
6+
name = "model",
7+
srcs = [
8+
"model.py",
9+
],
10+
deps = [
11+
"//caffe2:torch",
12+
"//executorch/examples/models:checkpoint",
13+
"//pytorch/torchtune:lib",
14+
"//executorch/extension/llm/modules:module_lib",
15+
],
16+
)
17+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
2+
3+
oncall("executorch")
4+
5+
python_library(
6+
name = "model",
7+
srcs = [
8+
"__init__.py",
9+
"model.py",
10+
],
11+
deps = [
12+
"//caffe2:torch",
13+
"//executorch/extension/llm/modules:module_lib",
14+
"//pytorch/torchtune:lib",
15+
"//executorch/examples/models:model_base",
16+
],
17+
)

exir/passes/TARGETS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,16 @@ python_library(
220220
],
221221
)
222222

223+
python_library(
224+
name = "init_mutable_pass",
225+
srcs = [
226+
"init_mutable_pass.py",
227+
],
228+
deps = [
229+
"//executorch/exir:delegate",
230+
],
231+
)
232+
223233
python_library(
224234
name = "sym_shape_eval_pass",
225235
srcs = [

extension/llm/modules/TARGETS

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
2+
3+
oncall("executorch")
4+
5+
python_library(
6+
name = "kv_cache",
7+
srcs = [
8+
"kv_cache.py",
9+
],
10+
deps = [
11+
"//caffe2:torch",
12+
"//pytorch/torchtune:lib",
13+
],
14+
)
15+
16+
python_library(
17+
name = "attention",
18+
srcs = [
19+
"attention.py",
20+
],
21+
deps = [
22+
":kv_cache",
23+
"//caffe2:torch",
24+
"//executorch/extension/llm/custom_ops:custom_ops",
25+
"//pytorch/torchtune:lib",
26+
],
27+
)
28+
29+
python_library(
30+
name = "position_embeddings",
31+
srcs = [
32+
"_position_embeddings.py",
33+
],
34+
deps = [
35+
"//caffe2:torch",
36+
],
37+
)
38+
39+
python_library(
40+
name = "module_lib",
41+
srcs = [
42+
"__init__.py",
43+
],
44+
deps= [
45+
":position_embeddings",
46+
":attention",
47+
":kv_cache",
48+
]
49+
)

0 commit comments

Comments
 (0)