Should I configure FP16, optimizers, batch_size in DeepSpeed config of Pytorch-Lightning? #12465
Answered
by
rohitgr7
ShaneTian
asked this question in
DDP / multi-GPU / multi-node
-
My {
"zero_optimization": {
"stage": 2,
"offload_optimizer": {
"device": "cpu",
"pin_memory": true
},
"allgather_partitions": true,
"allgather_bucket_size": 2e8,
"overlap_comm": true,
"reduce_scatter": true,
"reduce_bucket_size": 2e8,
"contiguous_gradients": true
},
"gradient_accumulation_steps": "auto",
"gradient_clipping": "auto",
"steps_per_print": 2000,
"train_batch_size": "auto",
"train_micro_batch_size_per_gpu": "auto",
"wall_clock_breakdown": false
} I have some questions about how to configure DeepSpeed in Pytorch-Lightning:
Thanks a lot!😊 |
Beta Was this translation helpful? Give feedback.
Answered by
rohitgr7
Mar 26, 2022
Replies: 1 comment 2 replies
-
yes, you don't need to set them inside config since this is done by Lightning already here if you set them in trainer and lightning module: https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pytorch_lightning/strategies/deepspeed.py |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
ShaneTian
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
yes, you don't need to set them inside config since this is done by Lightning already here if you set them in trainer and lightning module: https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pytorch_lightning/strategies/deepspeed.py