z2: don't pass dtype to report_ipg_memory_usage#7636
Merged
Conversation
This PR is fixing this:
```
[rank0]: File "/code/users/stas/github/DeepSpeed/deepspeed/runtime/zero/stage_1_and_2.py", line 985, in grad_handling_hook
[rank0]: self.process_gradients(param, i)
[rank0]: File "/code/users/stas/github/DeepSpeed/deepspeed/runtime/zero/stage_1_and_2.py", line 1524, in process_gradients
[rank0]: self.reduce_ready_partitions_and_remove_grads(param, i)
[rank0]: File "/code/users/stas/github/DeepSpeed/deepspeed/runtime/zero/stage_1_and_2.py", line 1528, in reduce_ready_partitions_and_remove_grads
[rank0]: self.reduce_independent_p_g_buckets_and_remove_grads(param, i)
[rank0]: File "/code/users/stas/github/DeepSpeed/deepspeed/runtime/zero/stage_1_and_2.py", line 1006, in reduce_independent_p_g_buckets_and_remove_grads
[rank0]: self.report_ipg_memory_usage("In ipg_remove_grads before reduce_ipg_grads", param.numel(), param.dtype)
[rank0]: File "/code/users/stas/github/DeepSpeed/deepspeed/runtime/base_optimizer.py", line 70, in report_ipg_memory_usage
[rank0]: bucket = self.ipg_buckets[dt]
[rank0]: ~~~~~~~~~~~~~~~~^^^^
```
the problem doesn't exist if: `seq_parallel_communication_data_type: bf16` is used, but fails with fp32.
In this PR I'm syncing with the z3 implementation which doesn't pass the `dtype`.
Fixes: #7607
sfc-gh-truwase
approved these changes
Oct 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is fixing this:
the problem doesn't exist if:
seq_parallel_communication_data_type: bf16is used, but fails withfp32(or no setting).In this PR I'm syncing with the z3 implementation which doesn't pass the
dtypearg and lets the traversal of existing dtypes do the thing.DeepSpeed/deepspeed/runtime/base_optimizer.py
Lines 66 to 75 in 407708c
Fixes: #7607