Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion finetune/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
save_interval = 1000
eval_iters = 100
log_interval = 1
devices = 1
devices = torch.cuda.device_count()

# Hyperparameters
learning_rate = 9e-3
Expand Down
2 changes: 1 addition & 1 deletion finetune/full.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
save_interval = 1000
eval_iters = 100
log_interval = 100
devices = 4
devices = torch.cuda.device_count()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
devices = torch.cuda.device_count()
devices = "auto"


# Hyperparameters
learning_rate = 3e-5
Expand Down
3 changes: 2 additions & 1 deletion finetune/lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def main(
out_dir: str = "out/lora/alpaca",
):

fabric = L.Fabric(accelerator="cuda", devices=1, precision="bf16-true")
devices = torch.cuda.device_count()
fabric = L.Fabric(accelerator="cuda", devices=devices, precision="bf16-true")
Comment on lines +53 to +54
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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")

Copy link
Contributor

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?

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.

fabric.launch()
fabric.seed_everything(1337 + fabric.global_rank)

Expand Down