-
Notifications
You must be signed in to change notification settings - Fork 517
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
Use all gpus available for training #293
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion @Abecid. In general the changes look good but it won't make much difference because we are keeping the batch size constant globally to keep it easy to reproduce results. In fact, if training fits in a single GPU and torch.cuda.device_count() selects more devices, it may actually be slower because of the reduced per-device batch size and communication overhead.
I vote for keeping the values as they are and instead advise users to scale both devices and batch size to their setup to maximize efficiency. We could add this info to the how-to guides. Let me know what you think.
@@ -31,7 +31,7 @@ | |||
save_interval = 1000 | |||
eval_iters = 100 | |||
log_interval = 100 | |||
devices = 4 | |||
devices = torch.cuda.device_count() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
devices = torch.cuda.device_count() | |
devices = "auto" |
devices = torch.cuda.device_count() | ||
fabric = L.Fabric(accelerator="cuda", devices=devices, precision="bf16-true") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
devices = torch.cuda.device_count() | |
fabric = L.Fabric(accelerator="cuda", devices=devices, precision="bf16-true") | |
fabric = L.Fabric(accelerator="cuda", devices="auto", precision="bf16-true") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Abecid Did multi-gpu training work with this script and how many did you use? Is the loss convergence comparable to single gpu training?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i ran this with two NVIDIA Tesla T4 cards with devices="auto"
and got this error:
RuntimeError: [1] is setting up NCCL communicator and retrieving ncclUniqueId from [0] via c10d key-value store by key '0', but store->get('0') got error: Broken pipe. This may indicate a possible application crash on rank 0 or a network set up issue.
Use all gpus available for training