Skip to content

Commit 67123b6

Browse files
larryliu0820facebook-github-bot
authored andcommitted
Refactor export_llama_lib.py
Summary: Refactor the hell out of export_llama_lib.py. All quantizer logic goes into `lib/quant_lib.py`. All partitioner logic goes into `lib/partitioner_lib.py`. All source transformation logic goes into `source_transformation/`. Reviewed By: iseeyuan, cccclai Differential Revision: D56372411 fbshipit-source-id: bfdf842980c7271aebaadfc445272fa4ca96f0d8
1 parent 90d0c1a commit 67123b6

File tree

11 files changed

+556
-495
lines changed

11 files changed

+556
-495
lines changed

examples/models/llama2/TARGETS

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ runtime.python_library(
2727
"__init__.py",
2828
"fairseq2.py",
2929
"model.py",
30-
"quantize.py",
3130
],
3231
_is_external_target = True,
3332
base_module = "executorch.examples.models.llama2",
@@ -66,9 +65,12 @@ runtime.python_library(
6665
"builder.py",
6766
"export_llama.py",
6867
"export_llama_lib.py",
68+
"lib/partitioner_lib.py",
69+
"lib/quant_lib.py",
6970
"model.py",
70-
"quant_lib.py",
71-
"quantize.py",
71+
"source_transformation/quantize.py",
72+
"source_transformation/rope.py",
73+
"source_transformation/sdpa.py",
7274
],
7375
_is_external_target = True,
7476
base_module = "executorch.examples.models.llama2",

0 commit comments

Comments
 (0)