Skip to content

Commit 72ebeda

Browse files
committed
[4/N] Autobucketing: bucket comms from greedy algorithm decisions
ghstack-source-id: 3860cb4 Pull-Request: #133
1 parent 5dc7399 commit 72ebeda

File tree

4 files changed

+1063
-5
lines changed

4 files changed

+1063
-5
lines changed

autoparallel/auto_bucketing.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import torch
77

8-
from .autobucketing_util import bucket_plan, bucket_utils
8+
from .autobucketing_util import bucket_func, bucket_plan, bucket_utils
99

1010

1111
class simplefsdp_autobucketing_config:
@@ -53,4 +53,22 @@ def simple_fsdp_autobucketing_reordering_pass(
5353
bucketable_nodes,
5454
configs,
5555
)
56+
57+
snodes = bucket_func.bucket_fsdp_all_gather_with_plan(
58+
scheduler,
59+
snodes,
60+
scheduler.name_to_buf,
61+
scheduler.name_to_fused_node,
62+
all_gather_plan,
63+
bucketable_nodes,
64+
)
65+
if len(reduce_scatter_plan) > 0:
66+
snodes = bucket_func.bucket_fsdp_reduce_scatter_with_plan(
67+
scheduler,
68+
snodes,
69+
scheduler.name_to_buf,
70+
scheduler.name_to_fused_node,
71+
reduce_scatter_plan,
72+
bucketable_nodes,
73+
)
5674
return snodes

0 commit comments

Comments
 (0)