DeepSpeed icon indicating copy to clipboard operation
DeepSpeed copied to clipboard

[Question] Does deepspeed support model parallelism via API "PipeModelDataParallelTopology"?

Open chenyaofo opened this issue 3 years ago • 1 comments

Describe the Question I just notice code in https://github.com/HuangLK/llama-deepspeed/blob/faedea514b11c18c695e1b2a6adb63b102ef001c/models/llama_pipeline_model.py#L174

It appears that the code is utilizing the PipeModelDataParallelTopology API. I'm curious to know if it supports model parallelism during training.

I have extensively searched the Internet, documents, and issues, but unfortunately, I have been unable to find an answer to this question. Furthermore, it seems that there are no available documents providing an explanation or usage guide for this particular API.

chenyaofo avatar Jun 15 '23 18:06 chenyaofo

Hi @chenyaofo , yes the PipeModelDataParallelTopology helps facilitate combining forms of parallelism for training (eg, 3D parallelism for LLMs). It's still up to the provided model to actually implement model parallelism, though. Those topology classes are used to coordinate distributed processes and establish a consistent mapping of ranks between parallel subgroups for the different parallelisms. This is important for situations like computing global norms for gradient clipping.

You'll also find this API used in our repo Megatron-DeepSpeed.

ShadenSmith avatar Jun 26 '23 20:06 ShadenSmith