Upload folder using huggingface_hub
Browse files
configs/verifier_v_7b.yaml
CHANGED
|
@@ -22,12 +22,12 @@ data:
|
|
| 22 |
val_path: "data/verifier/val.jsonl"
|
| 23 |
|
| 24 |
train:
|
| 25 |
-
max_length: 4096
|
| 26 |
per_device_train_batch_size: 16 # up from 4: ~4x fewer forward passes -> much faster
|
| 27 |
gradient_accumulation_steps: 1 # eff batch 16
|
| 28 |
-
gradient_checkpointing: true #
|
| 29 |
-
# ~
|
| 30 |
-
#
|
| 31 |
|
| 32 |
eval:
|
| 33 |
processbench_splits: ["gsm8k", "math", "olympiadbench", "omnimath"]
|
|
|
|
| 22 |
val_path: "data/verifier/val.jsonl"
|
| 23 |
|
| 24 |
train:
|
| 25 |
+
max_length: 2560 # measured: V data maxes at 2334 tokens (p99 1715) — 4096 was wasteful
|
| 26 |
per_device_train_batch_size: 16 # up from 4: ~4x fewer forward passes -> much faster
|
| 27 |
gradient_accumulation_steps: 1 # eff batch 16
|
| 28 |
+
gradient_checkpointing: true # MUST stay on for 7B (a bug had disabled it for bf16)
|
| 29 |
+
# ~30-40GB VRAM at these settings. To use more / go faster: raise batch to 24/32.
|
| 30 |
+
# NOTE: training has no auto-OOM-recovery — if it OOMs, lower the batch.
|
| 31 |
|
| 32 |
eval:
|
| 33 |
processbench_splits: ["gsm8k", "math", "olympiadbench", "omnimath"]
|
src/mathcompose/train/train.py
CHANGED
|
@@ -174,7 +174,12 @@ def build_and_train(args) -> str:
|
|
| 174 |
elif gc_mode == "off":
|
| 175 |
grad_ckpt = False
|
| 176 |
else:
|
| 177 |
-
grad_ckpt = bool(t.get("gradient_checkpointing", True))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
|
| 179 |
optim = t.get("optim", "paged_adamw_8bit") if use_4bit else "adamw_torch"
|
| 180 |
print(f"[train] epochs={epochs} batch={batch} accum={accum} (eff={batch * accum}) "
|
|
|
|
| 174 |
elif gc_mode == "off":
|
| 175 |
grad_ckpt = False
|
| 176 |
else:
|
| 177 |
+
grad_ckpt = bool(t.get("gradient_checkpointing", True)) # independent of quantization
|
| 178 |
+
|
| 179 |
+
# With a frozen (esp. non-kbit) base + LoRA, checkpointing needs input grads
|
| 180 |
+
# enabled so gradients reach the adapters.
|
| 181 |
+
if grad_ckpt and hasattr(model, "enable_input_require_grads"):
|
| 182 |
+
model.enable_input_require_grads()
|
| 183 |
|
| 184 |
optim = t.get("optim", "paged_adamw_8bit") if use_4bit else "adamw_torch"
|
| 185 |
print(f"[train] epochs={epochs} batch={batch} accum={accum} (eff={batch * accum}) "
|