Skip to content

Commit

Permalink
Bug fix for the "Link bit16 and fp32 parameters in partition" for MoE…
Browse files Browse the repository at this point in the history
… parameters"
  • Loading branch information
U-rara committed Jun 18, 2024
1 parent b33873d commit 027089d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions deepspeed/runtime/zero/stage_1_and_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,14 +573,13 @@ def _create_param_mapping(self):
return param_mapping

def _link_all_hp_params(self):
dp_world_size = dist.get_world_size(group=self.dp_process_group)
if self.cpu_offload:
self._get_offload_gradient_dict()

for i, _ in enumerate(self.optimizer.param_groups):
# Link bit16 and fp32 params in partition
partition_id = dist.get_rank(group=self.real_dp_process_group[i])
partition_size = self.bit16_groups_flat[i].numel() // dp_world_size
partition_size = self.bit16_groups_flat[i].numel() // dist.get_world_size(group=self.real_dp_process_group[i])
flat_hp_partition = self.single_partition_of_fp32_groups[i]
link_hp_params(lp_param_list=self.bit16_groups[i],
flat_hp_partition=flat_hp_partition,
Expand Down

0 comments on commit 027089d

Please sign in to comment.