Skip to content

Commit

Permalink
update lightning notebook language to inform user if running on colab…
Browse files Browse the repository at this point in the history
… to use GPU runtime
  • Loading branch information
Birmiwal, Rahul R committed Apr 10, 2024
1 parent 412231d commit e054d81
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"\n",
"This notebook also describes how to use **multi-GPU** distributed training.\n",
"\n",
"*For performance reasons, we only demonstrate single-GPU training. For a multi-GPU training example please refer to Part 6_lightning_multi_gpu.py*"
"*For performance reasons, we only demonstrate single-GPU training. For a multi-GPU training example please refer to Part 6_lightning_multi_gpu.py*\n",
"\n",
"**When running on Colab**: Please ensure your runtime has a GPU. Note that if using a single GPU runtime then the distributed GPU training example at the bottom of this notebook cannot be run"
]
},
{
Expand Down Expand Up @@ -276,11 +278,11 @@
],
"source": [
"# train with single GPU \n",
"lit_trainer = LitTrainer(epochs=200, accelerator='gpu', strategy='auto', devices=[1], custom_optimizer=optimizer)\n",
"lit_trainer = LitTrainer(epochs=200, accelerator='gpu', strategy='auto', devices=[0], custom_optimizer=optimizer)\n",
"lit_trainer.fit(problem, data_setup_function)\n",
"\n",
"# train with two GPU. \n",
"lit_trainer = LitTrainer(epochs=200, accelerator='gpu', strategy='ddp_notebook', devices=[1,2], custom_optimizer=optimizer)\n",
"lit_trainer = LitTrainer(epochs=200, accelerator='gpu', strategy='ddp_notebook', devices=[0,1], custom_optimizer=optimizer)\n",
"lit_trainer.fit(problem, data_setup_function)\n"
]
},
Expand Down

0 comments on commit e054d81

Please sign in to comment.