Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check for zero (empty) param groups in llama + hf/accelerate. #4270

Merged
merged 1 commit into from
Sep 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions deepspeed/runtime/zero/stage3.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,13 @@ def __init__(
count = count + 1

#Largest partitioned param
largest_partitioned_param_numel = max([
max([max(tensor.numel(), tensor.ds_numel) for tensor in fp16_partitioned_group])
for fp16_partitioned_group in self.fp16_partitioned_groups
])
largest_partitioned_param_numel = 0
for fp16_partitioned_group in self.fp16_partitioned_groups:
if len(fp16_partitioned_group) > 0:
largest_partitioned_param_numel = max(
largest_partitioned_param_numel,
max([max(tensor.numel(), tensor.ds_numel) for tensor in fp16_partitioned_group]))

print_rank_0(f'Largest partitioned param numel = {largest_partitioned_param_numel}', force=False)

self._setup_for_real_optimizer()
Expand Down
Loading