llm-foundry icon indicating copy to clipboard operation
llm-foundry copied to clipboard

How to use composer to train mpt-7b on a single gpu?

Open LisaWang0306 opened this issue 2 years ago • 2 comments

My server has 8 GPUs. I want to test it on single GPU. I set the num_workers=1 in the yaml file. But every time I run the command 'composer train.py yamls/mpt/finetune/try.yaml model.loss_fn=torch_crossentropy', there are still 8 ranks executing.

LisaWang0306 avatar May 15 '23 04:05 LisaWang0306

Hello @LisaWang0306 , thanks for the question! num_workers actually controls the number of CPU workers used for the dataloader. To use just one GPU, run something like:

composer -n 1 train.py yamls/mpt/finetune/try.yaml model.loss_fn=torch_crossentropy

The -n 1 tells composer to use only 1 rank. By default, composer will use all available GPUs. See composer --help for more information.

hanlint avatar May 15 '23 04:05 hanlint

Hello @LisaWang0306 , thanks for the question! num_workers actually controls the number of CPU workers used for the dataloader. To use just one GPU, run something like:

composer -n 1 train.py yamls/mpt/finetune/try.yaml model.loss_fn=torch_crossentropy

The -n 1 tells composer to use only 1 rank. By default, composer will use all available GPUs. See composer --help for more information.

Thanks very much for your reply! I will try soon.

LisaWang0306 avatar May 15 '23 04:05 LisaWang0306

Hi @LisaWang0306 , closing this for now. Please re-open if you run into any issues!

hanlint avatar May 19 '23 04:05 hanlint