Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to deploy multi-nodes training without hostfile? #811

Closed
SefaZeng opened this issue Mar 7, 2023 · 2 comments
Closed

How to deploy multi-nodes training without hostfile? #811

SefaZeng opened this issue Mar 7, 2023 · 2 comments
Labels
feature request New feature or request

Comments

@SefaZeng
Copy link

SefaZeng commented Mar 7, 2023

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I cant get the IP for each node before I started the training. The GPUs are allocated when you are starting a task, so I can't set the hostfile before. Can I use the multi-nodes training just like torch did? Just pass the master_addr and master_port?

@SefaZeng SefaZeng added the feature request New feature or request label Mar 7, 2023
@Quentin-Anthony
Copy link
Member

You can do one of two things:

#!/bin/bash
hostfile=/fsx/$(whoami)/hostfiles/hosts_$SLURM_JOBID
rm $hostfile &> /dev/null # for consecutive calls to this script in interactive jobs

# Iterate over the nodes allocated to your job
for i in `scontrol show hostnames $SLURM_NODELIST`
do
    # For each node, add num_gpus (8 here) as hosts
    echo $i slots=8 >>$hostfile
done
  • Alternatively, if your job scheduler provides a launcher (e.g. Slurm has srun), you can add that as a DeepSpeed multinode runner. We have already added a multinode runner with slurm/srun at Add SLURM Multinode Runner microsoft/DeepSpeed#2404 which you're encouraged to use.

@macabdul9
Copy link

macabdul9 commented May 3, 2023

Hi @Quentin-Anthony @StellaAthena ,

Can't find any documentation on how to use "SLURM Multinode Runner". Can you please provide more information about how to use without hostfile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants