Skip to content

Commit 0b62f55

Browse files
cccclaifacebook-github-bot
authored andcommitted
fix export llama to qnn
Summary: Regression from #8107, it causes buck run python binary fails. Then #7691 introduces dependency in source transformation Reviewed By: larryliu0820 Differential Revision: D69942429
1 parent 5e4b75b commit 0b62f55

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

examples/models/llama/TARGETS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ runtime.command_alias(
9696

9797
runtime.python_library(
9898
name = "source_transformation",
99+
visibility = [
100+
"//executorch/examples/...",
101+
],
99102
srcs = [
100103
"source_transformation/apply_spin_quant_r1_r2.py",
101104
"source_transformation/attention.py",

examples/qualcomm/oss_scripts/llama/TARGETS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ python_library(
1919
name = "llama_lib",
2020
srcs = ["llama.py"],
2121
deps = [
22+
"//executorch/examples/models/llama:source_transformation",
2223
"//caffe2:torch",
2324
"//executorch/backends/qualcomm/partition:partition",
2425
"//executorch/backends/qualcomm/quantizer:quantizer",

examples/qualcomm/oss_scripts/llama/llama.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,10 +1039,7 @@ def _build_parser():
10391039
return parser
10401040

10411041

1042-
def main(args) -> None:
1043-
parser = _build_parser()
1044-
1045-
args = parser.parse_args(args)
1042+
def export_llama(args) -> None:
10461043
if args.compile_only and args.pre_gen_pte:
10471044
exit("Cannot set both compile_only and pre_gen_pte as true")
10481045

@@ -1142,7 +1139,11 @@ def main(args) -> None:
11421139
else:
11431140
raise Exception(e)
11441141

1142+
def main():
1143+
parser = _build_parser()
1144+
args = parser.parse_args()
1145+
export_llama(args)
11451146

11461147
# flake8: noqa: C901
11471148
if __name__ == "__main__":
1148-
main(sys.argv[1:])
1149+
main()

0 commit comments

Comments
 (0)