Closed kobiso closed 3 years ago
I tried using it in the past per the commits you found. Sadly, I was unable to get it to work due to some lightning limitations. They are actively working on supporting manual optimization with DeepSpeed however it hasn't worked yet for this repo: https://github.com/PyTorchLightning/pytorch-lightning/issues/7957. If you want to try to help out the Lightning team, install the nightly build and open an issue. It may already even be fixed!
Sadly DeepSpeed dropped in my priorities since DDP works perfectly for my needs. If you manage to patch it, feel free to send a pull request!
Thanks for the reply! I shall check the link and try the nightly version :)
Hi @Zasder3, thank you for the great work!
I was wondering if you tried to use DeepSpeed because I saw this commit log (DeepSpeed Optimizer indexing). When I tried DeepSpeed by adding
--plugins deepspeed_stage_2
, I've got below errors.The error occurs in the below line, where we use
self.automatic_optimization = False
. https://github.com/Zasder3/train-CLIP/blob/ab1c59359a8e729fe05fd99aecdddf1eb9f43843/models/wrapper.py#L81I could use DeepSpeed by
self.automatic_optimization = True
withoutself.manual_backward(loss)
. (But still need some debugging because the training pattern changes.)My working environment are
pytorch=1.9, cuda=11.1, pytorch-lightning=1.3.8
. Thanks in advance!