feat: add RTX 5090 & 4090 configs (docs/RTX_CLOUD_RUN.md)
Browse files- docs/RTX_CLOUD_RUN.md +69 -0
docs/RTX_CLOUD_RUN.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RTX 5090 & RTX 4090 CLOUD PRETRAINING GUIDE
|
| 2 |
+
> Dedicated production setup for high-speed training of ViuMini-MoE-242M.
|
| 3 |
+
> Native BF16 + FlashAttention-2 + Non-blocking background checkpoint uploads.
|
| 4 |
+
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
## 1. Quick Setup (Run on any Cloud Instance / RunPod / Vast.ai / Lambda / Local PC)
|
| 8 |
+
|
| 9 |
+
Run these 3 lines in your terminal:
|
| 10 |
+
```bash
|
| 11 |
+
# 1. Clone repository from Hugging Face
|
| 12 |
+
git clone https://huggingface.co/ViuAI/ViuMini-MoE-242M
|
| 13 |
+
cd ViuMini-MoE-242M
|
| 14 |
+
|
| 15 |
+
# 2. Install dependencies
|
| 16 |
+
pip install -q torch pyarrow datasets tokenizers pyyaml huggingface_hub
|
| 17 |
+
|
| 18 |
+
# 3. Export your Hugging Face token (for auto-checkpoint uploads)
|
| 19 |
+
export HF_TOKEN="your_huggingface_token_here"
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
## 2. Launch on RTX 5090 (32GB GDDR7) — 1-Click Launch
|
| 25 |
+
|
| 26 |
+
* **Speed**: **~85,000 – 95,000 tokens/sec**
|
| 27 |
+
* **1 Step Time**: **~1.4 seconds** (Global 128 sequences = 131,072 tokens/step)
|
| 28 |
+
* **1,000 Steps**: **~24 minutes**
|
| 29 |
+
* **10,000 Steps (~1.31B tokens)**: **~4.0 hours** (Total cost @ ₹92/h: **₹368**)
|
| 30 |
+
|
| 31 |
+
```bash
|
| 32 |
+
python model/scripts/train.py \
|
| 33 |
+
--config model/configs/train_rtx5090.yaml \
|
| 34 |
+
--model_config model/configs/viu1_moe_config.yaml \
|
| 35 |
+
--hf_dataset ViuAI/viu-mini-raw-pretrain \
|
| 36 |
+
--resume auto
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
---
|
| 40 |
+
|
| 41 |
+
## 3. Launch on RTX 4090 (24GB GDDR6X) — 1-Click Launch
|
| 42 |
+
|
| 43 |
+
* **Speed**: **~50,000 – 58,000 tokens/sec**
|
| 44 |
+
* **1 Step Time**: **~2.5 seconds** (Global 128 sequences = 131,072 tokens/step)
|
| 45 |
+
* **1,000 Steps**: **~40 minutes**
|
| 46 |
+
* **10,000 Steps (~1.31B tokens)**: **~6.8 hours** (Total cost @ ₹69/h: **₹462**)
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
python model/scripts/train.py \
|
| 50 |
+
--config model/configs/train_rtx4090.yaml \
|
| 51 |
+
--model_config model/configs/viu1_moe_config.yaml \
|
| 52 |
+
--hf_dataset ViuAI/viu-mini-raw-pretrain \
|
| 53 |
+
--resume auto
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
---
|
| 57 |
+
|
| 58 |
+
## 4. Key Highlights & Safety Features
|
| 59 |
+
|
| 60 |
+
1. **Auto-Resume (`--resume auto`)**:
|
| 61 |
+
* If a checkpoint exists locally in `model/checkpoints/`, it resumes immediately.
|
| 62 |
+
* If running on a fresh cloud instance, it queries Hugging Face Hub (`ViuAI/ViuMini-MoE-242M`), downloads the highest step checkpoint automatically, and resumes seamlessly!
|
| 63 |
+
2. **Global Batch Parity (131,072 tokens/step)**:
|
| 64 |
+
* Both configs lock `target_global_batch: 128` (128 sequences x 1024 tokens = 131,072 tokens per step).
|
| 65 |
+
* Micro-batch: 16 (fits easily in 24GB/32GB VRAM).
|
| 66 |
+
* Gradient accumulation: 8 (cuts gradient accumulation loops in half compared to T4).
|
| 67 |
+
3. **Non-Blocking Background Checkpoint Uploads**:
|
| 68 |
+
* Forward/backward passes NEVER pause during multi-gigabyte Hugging Face uploads.
|
| 69 |
+
* Local disk keeps newest 2 full checkpoints (no disk full crash).
|