Auto-detect 2x GPUs in KAGGLE_RUN_SARUS_DPO.txt for 2x faster torchrun DDP
Browse files53 unmodified lines5455565758596061626364656667686970717273747553 unmodified linesshutil.copy(dl, sft_folder)print(f"✅ Downloaded SFT checkpoint to {sft_folder}")# 4. Launch DPO Training (Ultra-low VRAM: batch_size=2, grad_accum=8)cmd = [sys.executable, "code/train_dpo.py","--version", "5k","--sft_version", "v2","--epochs", "2","--batch_size", "2","--grad_accum", "8","--learning_rate", "5.0e-6","--min_lr", "1.0e-6","--beta", "0.1","--sft_weight", "0.15","--max_seq_len", "512","--eval_interval", "50","--push_to_hf"]print("\n🚀 Executing DPO Command:")print(" ".join(cmd))53 unmodified lines5455565758596061626364656667686970717273747576777879808182838485868788899091929394959653 unmodified linesshutil.copy(dl, sft_folder)print(f"✅ Downloaded SFT checkpoint to {sft_folder}")# 4. Launch DPO Training (Auto-detects 2x GPUs for 2x Faster DDP Execution)num_gpus = torch.cuda.device_count() if torch.cuda.is_available() else 1if num_gpus >= 2:print(f"\n🚀 Multi-GPU Cluster Detected: {num_gpus}x GPUs (Launching torchrun DDP for 2x Speed)...")cmd = [sys.executable, "-m", "torch.distributed.run", f"--nproc_per_node={num_gpus}","code/train_dpo.py","--version", "5k","--sft_version", "v2","--epochs", "2","--batch_size", "2","--grad_accum", "4","--learning_rate", "5.0e-6","--min_lr", "1.0e-6","--beta", "0.1","--sft_weight", "0.15","--max_seq_len", "512","--eval_interval", "50","--push_to_hf"]else:print(f"\n🚀 Single GPU mode detected. Launching DPO...")cmd = [sys.executable, "code/train_dpo.py","--version", "5k","--sft_version", "v2","--epochs", "2","--batch_size", "2","--grad_accum", "8","--learning_rate", "5.0e-6","--min_lr", "1.0e-6","--beta", "0.1","--sft_weight", "0.15","--max_seq_len", "512","--eval_interval", "50","--push_to_hf"]print("\n🚀 Executing DPO Command:")print(" ".join(cmd))
runners/KAGGLE_RUN_SARUS_DPO.txt+37-16