Datasets:
Tasks:
Text Generation
Languages:
English
Size:
n<1K
Tags:
code
notebooks
training-scripts
dataset:Nanthasit/sakthai-kaggle-notebooks
license-mit
dataset-card
License:
exp: SAK_LR override; 4e-4 diverges to NaN at 6 epochs
Browse files- job-0.5b-exp.py +4 -2
job-0.5b-exp.py
CHANGED
|
@@ -137,10 +137,12 @@ if MODE == "lora-masked":
|
|
| 137 |
r=16, lora_alpha=32, lora_dropout=0.05, bias="none", task_type="CAUSAL_LM", use_rslora=True,
|
| 138 |
target_modules=["q_proj","k_proj","v_proj","o_proj","gate_proj","up_proj","down_proj"]))
|
| 139 |
model.print_trainable_parameters()
|
| 140 |
-
|
|
|
|
|
|
|
| 141 |
else:
|
| 142 |
# Full fine-tune needs a far lower LR than LoRA; 4e-4 would destroy the base.
|
| 143 |
-
lr = 2e-5
|
| 144 |
print("full fine-tune: all", sum(p.numel() for p in model.parameters()), "params trainable")
|
| 145 |
|
| 146 |
args = SFTConfig(output_dir=f"out-{MODE}-{TAG}", num_train_epochs=EPOCHS, seed=SEED,
|
|
|
|
| 137 |
r=16, lora_alpha=32, lora_dropout=0.05, bias="none", task_type="CAUSAL_LM", use_rslora=True,
|
| 138 |
target_modules=["q_proj","k_proj","v_proj","o_proj","gate_proj","up_proj","down_proj"]))
|
| 139 |
model.print_trainable_parameters()
|
| 140 |
+
# 4e-4 (sqrt-scaled for batch 64) is marginally unstable: it survives 3 epochs
|
| 141 |
+
# but diverges to NaN by 6. Overridable so longer runs can drop it.
|
| 142 |
+
lr = float(os.environ.get("SAK_LR", "4e-4"))
|
| 143 |
else:
|
| 144 |
# Full fine-tune needs a far lower LR than LoRA; 4e-4 would destroy the base.
|
| 145 |
+
lr = float(os.environ.get("SAK_LR", "2e-5"))
|
| 146 |
print("full fine-tune: all", sum(p.numel() for p in model.parameters()), "params trainable")
|
| 147 |
|
| 148 |
args = SFTConfig(output_dir=f"out-{MODE}-{TAG}", num_train_epochs=EPOCHS, seed=SEED,
|