Commit 1198b04
committed
[Executorch][llm] Enable local global attention in export_llama script
Pull Request resolved: #10612
Added a new option of --local_global_attention that takes in pattern of sizes to determine which layers are using local sliding window attention.
For example, [0, 256, 256, 0, 256, 256] can be used for 6 layers transformer. Or you can also use [0, 256, 256] as pattern you want
to repeat.
ghstack-source-id: 282458841
@exported-using-ghexport
Differential Revision: [D73891423](https://our.internmc.facebook.com/intern/diff/D73891423/)1 parent 04a1aa0 commit 1198b04
File tree
2 files changed
+47
-1
lines changed- examples/models/llama
- source_transformation
2 files changed
+47
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
156 | 174 | | |
157 | 175 | | |
158 | 176 | | |
| |||
363 | 381 | | |
364 | 382 | | |
365 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
366 | 391 | | |
367 | 392 | | |
368 | 393 | | |
| |||
1307 | 1332 | | |
1308 | 1333 | | |
1309 | 1334 | | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
1310 | 1343 | | |
1311 | 1344 | | |
1312 | 1345 | | |
| |||
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
519 | 519 | | |
520 | 520 | | |
521 | 521 | | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
522 | 531 | | |
523 | | - | |
| 532 | + | |
524 | 533 | | |
525 | 534 | | |
526 | 535 | | |
| |||
534 | 543 | | |
535 | 544 | | |
536 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
537 | 550 | | |
0 commit comments