Skip to content

Commit 8f99a2f

Browse files
[graph_trainer][aot_fx_trace][graph_pp] Add DualPipeV scheduling placeholder
Reserve an optional keyword on the GraphPP forward/backward multiplexing helper for future DualPipeV scheduling work. The flag defaults to False and intentionally has no behavior in this commit, leaving the current multiplexed graph construction unchanged. This replaces the previous fused-edge FSDP experiment with a small placeholder surface for the next scheduling iteration. stack-info: PR: #3585, branch: sanketpurandare/stack/19
1 parent d62382e commit 8f99a2f

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

torchtitan/experiments/graph_trainer/graph_pp/graph_multiplex.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ def _copy_prefixed_get_attrs(
4444
def multiplex_fw_bw_graph(
4545
fw_gm: fx.GraphModule,
4646
bw_gm: fx.GraphModule,
47+
*,
48+
overlap: bool = False,
4749
) -> fx.GraphModule:
4850
"""Concatenate backward and forward graphs into one boxed GraphPP callable.
4951
@@ -62,6 +64,9 @@ def multiplex_fw_bw_graph(
6264
copy backward compute nodes before the forward compute nodes
6365
replace the output tuple with backward outputs followed by forward outputs
6466
67+
``overlap`` is reserved for future DualPipeV scheduling work; the current
68+
placeholder does not change graph construction.
69+
6570
The forward graph remains the destination module because its ShapeEnv owns
6671
the dynamic collective-size constraints needed by full Inductor for MoE
6772
all-to-all outputs. The backward graph is inserted in topological order
@@ -76,6 +81,8 @@ def multiplex_fw_bw_graph(
7681
namespace become the destination for the multiplexed graph.
7782
bw_gm (fx.GraphModule): Backward graph copied before the forward graph
7883
inside the multiplexed callable.
84+
overlap (bool): Reserved placeholder for future DualPipeV scheduling
85+
work. Defaults to ``False`` and currently has no behavior.
7986
8087
Returns:
8188
fx.GraphModule: One graph module with placeholders ordered as

torchtitan/experiments/graph_trainer/tests/test_graph_pp_runner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,7 @@ def test_multiplexed_graph_returns_backward_then_forward_outputs(self) -> None:
861861
multiplexed = multiplex_fw_bw_graph(
862862
stage.graphs.modules.fw,
863863
stage.graphs.modules.full_bw,
864+
overlap=True,
864865
)
865866

866867
multiplexed_outputs = _boxed_run(

0 commit comments

Comments
 (0)