|
| 1 | +# Arbor Deployment Guide |
| 2 | + |
| 3 | +This directory contains SkyPilot configurations for running Arbor GRPO training jobs on cloud infrastructure. |
| 4 | + |
| 5 | +## Quick Start |
| 6 | + |
| 7 | +### Prerequisites |
| 8 | + |
| 9 | +- [SkyPilot](https://skypilot.readthedocs.io/) installed: `pip install skypilot[aws]` (or your cloud provider) |
| 10 | +- AWS/GCP/other cloud credentials configured |
| 11 | +- An S3 bucket (or equivalent) for storing checkpoints |
| 12 | + |
| 13 | +### Running Any Training Script |
| 14 | + |
| 15 | +The `skypilot_example.yaml` configuration is designed to work with any Python training script. Scripts run from the project root directory, so use paths relative to root (e.g., `examples/your_script.py`). |
| 16 | + |
| 17 | +#### Step 1: Configure Your Training Script |
| 18 | + |
| 19 | +```bash |
| 20 | +sky jobs launch -n training-job deploy/skypilot_example.yaml \ |
| 21 | + --env TRAINING_SCRIPT=examples/your_script.py \ |
| 22 | + --infra aws |
| 23 | +``` |
| 24 | + |
| 25 | +**Example:** |
| 26 | +```bash |
| 27 | +sky jobs launch -n banking-training deploy/skypilot_example.yaml \ |
| 28 | + --env TRAINING_SCRIPT=examples/banking_grpo.py \ |
| 29 | + --infra aws |
| 30 | +``` |
| 31 | + |
| 32 | +#### Step 2: Configure Your Checkpoint S3 Bucket |
| 33 | + |
| 34 | +Edit `skypilot_example.yaml` and update the checkpoint bucket path (around line 25): |
| 35 | + |
| 36 | +```yaml |
| 37 | +file_mounts: |
| 38 | + /mnt/checkpoints: |
| 39 | + source: s3://your-bucket-name/ # Change this to your S3 bucket |
| 40 | + mode: MOUNT_CACHED |
| 41 | +``` |
| 42 | +
|
| 43 | +Replace `s3://your-bucket-name/` with your actual S3 bucket path. The bucket should already exist and be accessible with your cloud credentials. |
| 44 | + |
| 45 | +#### Step 3: Customize Setup (if needed) |
| 46 | + |
| 47 | +If your script requires additional dependencies or data downloads, edit the `setup` section in `skypilot_example.yaml`: |
| 48 | + |
| 49 | +```yaml |
| 50 | +setup: | |
| 51 | + # ... common setup ... |
| 52 | +
|
| 53 | + # Add your script-specific dependencies: |
| 54 | + uv pip install package-name |
| 55 | +
|
| 56 | + # Add your script-specific data downloads: |
| 57 | + curl -Ls https://example.com/data.tar.gz | tar -xz -C examples |
| 58 | +``` |
| 59 | + |
| 60 | +**Example for `multihop_dev.py`:** |
| 61 | +```yaml |
| 62 | +setup: | |
| 63 | + # ... common setup ... |
| 64 | + uv pip install ujson bm25s PyStemmer "jax[cpu]" |
| 65 | + curl -Ls https://huggingface.co/dspy/cache/resolve/main/wiki.abstracts.2017.tar.gz | tar -xz -C examples |
| 66 | +``` |
| 67 | + |
| 68 | +#### Step 4: Launch the Training Job |
| 69 | + |
| 70 | +```bash |
| 71 | +sky jobs launch -n training-job deploy/skypilot_example.yaml --infra <aws|gcp|nebius|lambda> |
| 72 | +``` |
| 73 | + |
| 74 | +Replace `<aws|gcp|nebius|lambda>` with your cloud provider. |
| 75 | + |
| 76 | +#### Step 5: Monitor Progress |
| 77 | + |
| 78 | +```bash |
| 79 | +# View logs |
| 80 | +sky logs training-job |
| 81 | +
|
| 82 | +# Check job status |
| 83 | +sky status |
| 84 | +``` |
| 85 | + |
| 86 | +#### Step 6: Stop the Job (if needed) |
| 87 | + |
| 88 | +```bash |
| 89 | +sky jobs cancel training-job |
| 90 | +``` |
| 91 | + |
| 92 | +## Configuration Details |
| 93 | + |
| 94 | +### Resources |
| 95 | + |
| 96 | +- **GPUs**: 4x L40S GPUs by default (adjust based on your script's needs) |
| 97 | +- **Spot Instances**: Disabled by default (`use_spot: false`). Set to `true` for cost savings |
| 98 | +- **Disk**: 256 GB |
| 99 | + |
| 100 | +### DeepSpeed Configuration |
| 101 | + |
| 102 | +The training uses DeepSpeed ZeRO-3 (configured in `../configs/deepspeed_config.yaml`): |
| 103 | + |
| 104 | +### What Gets Installed |
| 105 | + |
| 106 | +The setup script automatically installs: |
| 107 | +- Project dependencies via `uv sync` |
| 108 | +- Common packages: `datasets`, `deepspeed`, `accelerate` |
| 109 | + |
| 110 | +You can add script-specific dependencies in the setup section. |
| 111 | + |
| 112 | +## Examples |
| 113 | + |
| 114 | +### Running multihop_dev.py |
| 115 | + |
| 116 | +1. Edit `skypilot_example.yaml` setup section to uncomment multihop-specific setup: |
| 117 | +```yaml |
| 118 | +uv pip install ujson bm25s PyStemmer "jax[cpu]" |
| 119 | +curl -Ls https://huggingface.co/dspy/cache/resolve/main/wiki.abstracts.2017.tar.gz | tar -xz -C examples |
| 120 | +``` |
| 121 | + |
| 122 | +2. The script path is already set to `examples/multihop_dev.py` by default |
| 123 | + |
| 124 | +3. Launch: |
| 125 | +```bash |
| 126 | +sky jobs launch -n multihop-dev deploy/skypilot_example.yaml --infra aws |
| 127 | +``` |
| 128 | + |
| 129 | +### Running banking_grpo.py |
| 130 | + |
| 131 | +1. Edit the script path in the run section: |
| 132 | +```yaml |
| 133 | +TRAINING_SCRIPT=${TRAINING_SCRIPT:-examples/banking_grpo.py} |
| 134 | +``` |
| 135 | + |
| 136 | +2. Launch (without accelerate, since it doesn't need distributed training): |
| 137 | +```bash |
| 138 | +sky jobs launch -n banking-training deploy/skypilot_example.yaml --infra aws |
| 139 | +``` |
| 140 | + |
| 141 | +Or if you want to use accelerate anyway: |
| 142 | +```bash |
| 143 | +sky jobs launch -n banking-training deploy/skypilot_example.yaml \ |
| 144 | + --env TRAINING_SCRIPT=examples/banking_grpo.py \ |
| 145 | + --env USE_ACCELERATE=true \ |
| 146 | + --infra aws |
| 147 | +``` |
| 148 | + |
| 149 | +No additional setup needed - it only uses standard dependencies. |
| 150 | + |
| 151 | +## Customization |
| 152 | + |
| 153 | +### Changing GPU Count |
| 154 | + |
| 155 | +To use a different number of GPUs, modify `skypilot_example.yaml`: |
| 156 | + |
| 157 | +```yaml |
| 158 | +resources: |
| 159 | + accelerators: L40S:4 # Change number as needed |
| 160 | +``` |
| 161 | + |
| 162 | +**Note**: If you change the GPU count and your script uses accelerate, make sure the number matches your script's expectations. |
| 163 | + |
| 164 | +### Using Spot Instances |
| 165 | + |
| 166 | +For cost savings, enable spot instances: |
| 167 | + |
| 168 | +```yaml |
| 169 | +resources: |
| 170 | + use_spot: true |
| 171 | +``` |
| 172 | + |
| 173 | +### Changing Cloud Providers |
| 174 | + |
| 175 | +SkyPilot supports multiple providers. Specify during launch: |
| 176 | + |
| 177 | +```bash |
| 178 | +sky jobs launch -n training-job deploy/skypilot_example.yaml --infra aws |
| 179 | +sky jobs launch -n training-job deploy/skypilot_example.yaml --infra gcp |
| 180 | +sky jobs launch -n training-job deploy/skypilot_example.yaml --infra azure |
| 181 | +``` |
| 182 | + |
| 183 | + |
| 184 | + |
| 185 | +## Additional Resources |
| 186 | + |
| 187 | +- [SkyPilot Documentation](https://skypilot.readthedocs.io/) |
| 188 | +- [DeepSpeed Documentation](https://www.deepspeed.ai/) |
| 189 | +- [Arbor Documentation](../README.md) |
0 commit comments