|
6 | 6 | "metadata": {},
|
7 | 7 | "source": [
|
8 | 8 | "Copyright (c) Meta Platforms, Inc. and affiliates.\n",
|
9 |
| - "This software may be used and distributed according to the terms of the Llama 2 Community License Agreement." |
| 9 | + "This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.\n", |
| 10 | + "\n", |
| 11 | + "<a href=\"https://colab.research.google.com/github/meta-llama/llama-recipes/blob/main/recipes/finetuning/quickstart_peft_finetuning.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" |
10 | 12 | ]
|
11 | 13 | },
|
12 | 14 | {
|
|
18 | 20 | "\n",
|
19 | 21 | "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 | 22 | "\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", |
| 23 | + "**_Note:_** To run this notebook on a machine with less than 24GB VRAM (e.g. T4 with 16GB) the context length of the training dataset needs to be adapted.\n", |
22 | 24 | "We do this based on the available VRAM during execution.\n",
|
23 | 25 | "If you run into OOM issues try to further lower the value of train_config.context_length."
|
24 | 26 | ]
|
|
38 | 40 | "metadata": {},
|
39 | 41 | "outputs": [],
|
40 | 42 | "source": [
|
| 43 | + "# uncomment if running from Colab T4\n", |
41 | 44 | "# ! pip install llama-recipes ipywidgets\n",
|
42 | 45 | "\n",
|
43 | 46 | "# import huggingface_hub\n",
|
|
95 | 98 | "train_config.lr = 3e-4\n",
|
96 | 99 | "train_config.use_fast_kernels = True\n",
|
97 | 100 | "train_config.use_fp16 = True\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", |
| 101 | + "train_config.context_length = 1024 if torch.cuda.get_device_properties(0).total_memory < 16e9 else 2048 # T4 16GB or A10 24GB\n", |
99 | 102 | "train_config.batching_strategy = \"packing\"\n",
|
100 | 103 | "train_config.output_dir = \"meta-llama-samsum\"\n",
|
101 | 104 | "\n",
|
|
464 | 467 | "name": "python",
|
465 | 468 | "nbconvert_exporter": "python",
|
466 | 469 | "pygments_lexer": "ipython3",
|
467 |
| - "version": "3.11.9" |
| 470 | + "version": "3.10.14" |
468 | 471 | },
|
469 | 472 | "vscode": {
|
470 | 473 | "interpreter": {
|
|
0 commit comments