Reduce context 4096->3072, add expandable_segments for OOM fix
Browse files- train_dpo.py +4 -2
train_dpo.py
CHANGED
|
@@ -22,6 +22,8 @@ import sys
|
|
| 22 |
import torch
|
| 23 |
from typing import Optional
|
| 24 |
|
|
|
|
|
|
|
| 25 |
# ============================================================
|
| 26 |
# CONFIG
|
| 27 |
# ============================================================
|
|
@@ -57,8 +59,8 @@ class Config:
|
|
| 57 |
per_device_train_batch_size = 1
|
| 58 |
gradient_accumulation_steps = 4
|
| 59 |
num_train_epochs = 1
|
| 60 |
-
max_length =
|
| 61 |
-
max_prompt_length =
|
| 62 |
logging_steps = 10
|
| 63 |
save_steps = 200
|
| 64 |
eval_steps = 200
|
|
|
|
| 22 |
import torch
|
| 23 |
from typing import Optional
|
| 24 |
|
| 25 |
+
os.environ.setdefault("PYTORCH_CUDA_ALLOC_CONF", "expandable_segments:True")
|
| 26 |
+
|
| 27 |
# ============================================================
|
| 28 |
# CONFIG
|
| 29 |
# ============================================================
|
|
|
|
| 59 |
per_device_train_batch_size = 1
|
| 60 |
gradient_accumulation_steps = 4
|
| 61 |
num_train_epochs = 1
|
| 62 |
+
max_length = 3072
|
| 63 |
+
max_prompt_length = 2304
|
| 64 |
logging_steps = 10
|
| 65 |
save_steps = 200
|
| 66 |
eval_steps = 200
|