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
[AutoTP] Allow ZeRO stage 3 inference with tensor parallelism
Replace the unconditional `zero_optimization_stage() <= 2` guard with one that
only blocks `autotp + zero_stage == 3` when an optimizer is present. The
inference path (no optimizer -> DummyOptim -> DeepSpeedZeRoOffload) is now
permitted; the training path (optimizer -> DeepSpeedZeroOptimizer_Stage3) is
blocked with a clear NotImplementedError.
Rationale: training under autotp+ZeRO-3 itself works (forward/backward/step and
gradient norms match the non-TP baseline), but the TP-aware checkpoint
consolidation path (`_consolidated_16bit_state_dict` / `save_16bit_model`)
gathers only the ZeRO data-parallel partition and would silently write rank 0's
TP shard instead of the full weight, producing incomplete checkpoints. Training
support will land alongside the checkpoint fix (tracked separately).
Signed-off-by: Guokai Ma <guokai.ma@intel.com>
Copy file name to clipboardExpand all lines: docs/_pages/config-json.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -763,7 +763,7 @@ Configuring the asynchronous I/O module for offloading parameter and optimizer s
763
763
| Submit requests to storage device in an overlapped fashion without waiting for completion of earlier requests. |`true`|
764
764
765
765
### Tensor Parallel (AutoTP)
766
-
Configure AutoTP tensor parallelism for training via the DeepSpeed config and hybrid TP + ZeRO. AutoTP supports ZeRO stages 0, 1, and 2 (stage 3 is not supported). `deepspeed.tp_model_init()` remains supported for backward compatibility but is not required when `tensor_parallel` is set in the config.
766
+
Configure AutoTP tensor parallelism for training via the DeepSpeed config and hybrid TP + ZeRO. AutoTP supports ZeRO stages 0, 1, and 2. ZeRO stage 3 is supported only for inference (no optimizer); training with stage 3 is not yet supported. `deepspeed.tp_model_init()` remains supported for backward compatibility but is not required when `tensor_parallel` is set in the config.
767
767
768
768
When a HuggingFace model provides a built-in `tp_plan` (via `model.config.base_model_tp_plan`), DeepSpeed automatically detects and uses it. In this case, neither `preset_model` nor `partition_config` is required -- just set `autotp_size`. If `partition_config` is also provided, it takes precedence over the model's `tp_plan`.
Copy file name to clipboardExpand all lines: docs/_tutorials/autotp-training.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -212,7 +212,7 @@ For Grouped Query Attention with different Q/K/V sizes:
212
212
213
213
## Limitations
214
214
215
-
1.**ZeRO Stage 3 not supported**: AutoTP currently only works with ZeRO stages 0, 1, and 2.
215
+
1.**ZeRO Stage 3 training not supported**: AutoTP with ZeRO stage 3 is supported only for inference (no optimizer). Training with an optimizer is blocked until TP-aware checkpoint consolidation is implemented.
216
216
217
217
2.**TP size must divide model dimensions**: The tensor parallel size must evenly divide the attention head count and hidden dimensions.
0 commit comments