Commit 0d936f8
committed
feat: experimental two-phase (head-chunked) Ulysses all-to-all
Add an opt-in ULYSSES_ATTENTION_CHUNKS env var to split the Ulysses
all-to-all into per-head-group passes, so XLA's async-collective
scheduler can overlap one group's attention compute with the next
group's all-to-all. Defaults to 1 (current single-shot path, no
behavior change). Numerically identical to single-shot since heads
are independent.
Notes:
- Requires async-collective LIBTPU flags to actually overlap.
- Needs heads % (context_shards * chunks) == 0.
- Gain is largest when all-to-all is a meaningful fraction of attention
time (high context-parallelism / shorter sequences); at WAN 2.2 720p
(seq~75600) it is compute-bound so the win is small (~3% in microbench).1 parent 08566b1 commit 0d936f8
1 file changed
Lines changed: 33 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
605 | 606 | | |
606 | 607 | | |
607 | 608 | | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
608 | 624 | | |
609 | 625 | | |
610 | 626 | | |
| |||
721 | 737 | | |
722 | 738 | | |
723 | 739 | | |
724 | | - | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
725 | 757 | | |
726 | 758 | | |
727 | 759 | | |
| |||
0 commit comments