diff --git a/docs/debugging.md b/docs/debugging.md index f40b12dd4..ad66493a1 100644 --- a/docs/debugging.md +++ b/docs/debugging.md @@ -10,6 +10,10 @@ This document provides some tips and tricks for debugging Axolotl. It also prov - [Configuration](#configuration) - [Customizing your debugger](#customizing-your-debugger) - [Video Tutorial](#video-tutorial) +- [Debugging With Docker](#debugging-with-docker) + - [Setup](#setup) + - [Attach To Container](#attach-to-container) + - [Video - Attaching To Docker On Remote Host](#video---attaching-to-docker-on-remote-host) ## General Tips @@ -18,7 +22,8 @@ While debugging it's helpful to simplify your test scenario as much as possible. > [!Important] > All of these tips are incorporated into the [example configuration](#configuration) for debugging with VSCode below. -1. **Eliminate Concurrency**: Restrict the number of processes to 1 for both training and data preprocessing: +1. **Make sure you are using the latest version of axolotl**: This project changes often and bugs get fixed fast. Check your git branch and make sure you have pulled the latest changes from `main`. +1. **Eliminate concurrency**: Restrict the number of processes to 1 for both training and data preprocessing: - Set `CUDA_VISIBLE_DEVICES` to a single GPU, ex: `export CUDA_VISIBLE_DEVICES=0`. - Set `dataset_processes: 1` in your axolotl config or run the training command with `--dataset_processes=1`. 2. **Use a small dataset**: Construct or use a small dataset from HF Hub. When using a small dataset, you will often have to make sure `sample_packing: False` and `eval_sample_packing: False` to avoid errors. If you are in a pinch and don't have time to construct a small dataset but want to use from the HF Hub, you can shard the data (this will still tokenize the entire dataset, but will only use a fraction of the data for training. For example, to shard the dataset into 20 pieces, add the following to your axolotl config): @@ -56,6 +61,21 @@ datasets: >[!Tip] > If you prefer to watch a video, rather than read, you can skip to the [video tutorial](#video-tutorial) below (but doing both is recommended). +### Setup + +Make sure you have an [editable install](https://setuptools.pypa.io/en/latest/userguide/development_mode.html) of Axolotl, which ensures that changes you make to the code are reflected at runtime. Run the following commands from the root of this project: + +```bash +pip3 install packaging +pip3 install -e '.[flash-attn,deepspeed]' +``` + +#### Remote Hosts + +If you developing on a remote host, you can easily use VSCode to debug remotely. To do so, you will need to follow this [remote - SSH guide](https://code.visualstudio.com/docs/remote/ssh). You can also see the video below on [Docker and Remote SSH debugging](#video---attaching-to-docker-on-remote-host). + +```bash + ### Configuration The easiest way to get started is to modify the [.vscode/launch.json](../.vscode/launch.json) file in this project. This is just an example configuration, so you may need to modify or copy it to suit your needs. @@ -150,7 +170,7 @@ The following video tutorial walks through the above configuration and demonstra
@@ -160,6 +180,63 @@ style="border-radius: 10px; display: block; margin: auto;" width="560" height="3