Skip to content

Commit

Permalink
Skip hierarchical partitioning ZeRO (hpZ) for single node (microsoft#717
Browse files Browse the repository at this point in the history
)
  • Loading branch information
HeyangQin authored and LeetJoe committed Sep 15, 2023
1 parent ffb8fb4 commit 92d9b88
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion applications/DeepSpeed-Chat/training/utils/ds_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# DeepSpeed Team

import torch
import deepspeed.comm as dist

GLOBAL_BATCH_SIZE = 32
MICRO_BATCH_SIZE = 4
Expand Down Expand Up @@ -38,7 +39,9 @@ def get_train_ds_config(offload,
}
if enable_mixed_precision_lora:
zero_opt_dict["zero_quantized_nontrainable_weights"] = True
zero_opt_dict["zero_hpz_partition_size"] = torch.cuda.device_count()
if dist.get_world_size() != torch.cuda.device_count():
zero_opt_dict["zero_hpz_partition_size"] = torch.cuda.device_count(
)
return {
"train_batch_size": GLOBAL_BATCH_SIZE,
"train_micro_batch_size_per_gpu": MICRO_BATCH_SIZE,
Expand Down

0 comments on commit 92d9b88

Please sign in to comment.