You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d5edbb4
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/training/performance-tuning.mdx
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,23 +110,23 @@ Additionally, because CP shards activations, it also partitions optimizer states
110
110
> > 2. In FSDP training, activation storage remains as the main memory bottleneck because FSDP only shards model state memory, and a large per-GPU activation is needed to hide the costly FSDP communication. On GB200 GPUs, Megatron-Bridge offers an option to offload activations to the host memory via a high-speed chip-to-chip interconnect.
111
111
> > 3. Baseline training is host performance-bound, but FSDP allows for larger per-GPU tensor sizes by eliminating TP or enabling a larger micro-batch size.
112
112
113
-
<!--TODO:supportmegatroncustomfsdp-->
114
-
<!-- > 1. Megatron-Bridge supports two Fully Sharded Data Parallelism (FSDP) implementations: PyTorch-native FSDP and a custom Megatron FSDP built within Megatron Core. While both follow the same sharding principles, the custom implementation is further optimized for performance. The performance gain of the custom FSDP comes primarily from minimizing the data movement to the communication tensors and reusing communication buffers. Both FSDP methods can be used in combination with per-tensor sharding methods. -->
<!-- > 2. FSDP can be preferred over TP+PP+DP mappings in the following scenarios: -->
126
-
<!-- > -->
127
-
<!-- > > 1. Small models with a large sequence, thus the parameter AllGather and gradient ReduceScatter can effectively be hidden under computation and the short communication overlap causes minor interference to the computation under overlap. -->
128
-
<!-- > > 2. In FSDP training, activation storage remains as the main memory bottleneck because FSDP only shards model state memory, and a large per-GPU activation is needed to hide the costly FSDP communication. On GB200 GPUs, Megatron-Bridge offers an option to offload activations to the host memory via a high-speed chip-to-chip interconnect. -->
129
-
<!-- > > 3. Baseline training is host performance-bound, but FSDP allows for larger per-GPU tensor sizes by eliminating TP or enabling a larger micro-batch size. -->
113
+
{/* TODO: support megatron custom fsdp */}
114
+
{/* > 1. Megatron-Bridge supports two Fully Sharded Data Parallelism (FSDP) implementations: PyTorch-native FSDP and a custom Megatron FSDP built within Megatron Core. While both follow the same sharding principles, the custom implementation is further optimized for performance. The performance gain of the custom FSDP comes primarily from minimizing the data movement to the communication tensors and reusing communication buffers. Both FSDP methods can be used in combination with per-tensor sharding methods. */}
{/* > 2. FSDP can be preferred over TP+PP+DP mappings in the following scenarios: */}
126
+
{/* > */}
127
+
{/* > > 1. Small models with a large sequence, thus the parameter AllGather and gradient ReduceScatter can effectively be hidden under computation and the short communication overlap causes minor interference to the computation under overlap. */}
128
+
{/* > > 2. In FSDP training, activation storage remains as the main memory bottleneck because FSDP only shards model state memory, and a large per-GPU activation is needed to hide the costly FSDP communication. On GB200 GPUs, Megatron-Bridge offers an option to offload activations to the host memory via a high-speed chip-to-chip interconnect. */}
129
+
{/* > > 3. Baseline training is host performance-bound, but FSDP allows for larger per-GPU tensor sizes by eliminating TP or enabling a larger micro-batch size. */}
130
130
131
131
4. Heterogeneous Encoder Parallelism
132
132
@@ -188,9 +188,9 @@ Additionally, because CP shards activations, it also partitions optimizer states
188
188
> > > 1.`NVTE_FWD_LAYERNORM_SM_MARGIN=<#SM for DP collectives = 16>`
189
189
> > > 2.`NVTE_BWD_LAYERNORM_SM_MARGIN=<#SM for DP collectives = 16>`
190
190
191
-
<!--2.CustomMegatronFSDP-->
191
+
{/* 2. Custom Megatron FSDP */}
192
192
193
-
<!-- > 1. Unless you specify the communication bucket size, MCORE FSDP uses fixed communication overlap that overlaps the parameter AllGather and gradient ReduceScatter of each Transformer layer with its associated forward and backward computations. -->
193
+
{/* > 1. Unless you specify the communication bucket size, MCORE FSDP uses fixed communication overlap that overlaps the parameter AllGather and gradient ReduceScatter of each Transformer layer with its associated forward and backward computations. */}
194
194
195
195
3. Tensor-parallel (TP) communication (with sequence parallelism)
196
196
@@ -793,5 +793,5 @@ uv run python -u /home/dpsk_a2a/deepep/tests/test_internode.py
0 commit comments