Skip to content

Commit dfbe613

Browse files
committed
Make quickstart finetuning notebook ready for T4
1 parent 0000619 commit dfbe613

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

recipes/finetuning/quickstart_peft_finetuning.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
1616
"source": [
1717
"## PEFT Finetuning Quick Start Notebook\n",
1818
"\n",
19-
"This notebook shows how to train a Meta Llama 3 model on a single GPU (e.g. A10 with 24GB) using int8 quantization and LoRA."
19+
"This notebook shows how to train a Meta Llama 3 model on a single GPU (e.g. A10 with 24GB) using int8 quantization and LoRA finetuning.\n",
20+
"\n",
21+
"**_Note:_** To run this notebook on a machine with less than 24GB VRAM (e.g. T4 with 15GB) the context length of the training dataset needs to be adapted.\n",
22+
"We do this based on the available VRAM during execution.\n",
23+
"If you run into OOM issues try to further lower the value of train_config.context_length."
2024
]
2125
},
2226
{
@@ -91,7 +95,7 @@
9195
"train_config.lr = 3e-4\n",
9296
"train_config.use_fast_kernels = True\n",
9397
"train_config.use_fp16 = True\n",
94-
"train_config.context_length = 2048\n",
98+
"train_config.context_length = 1024 if torch.cuda.get_device_properties(0).total_memory < 16e9 else 2048 # T4 15GB or A10 24GB\n",
9599
"train_config.batching_strategy = \"packing\"\n",
96100
"train_config.output_dir = \"meta-llama-samsum\"\n",
97101
"\n",

0 commit comments

Comments
 (0)