| param( | |
| [string]$Config = "configs/train_2gpu_4090d.json", | |
| [int]$Start = 8, | |
| [int]$Stop = 32, | |
| [int]$Step = 2 | |
| ) | |
| $ErrorActionPreference = "Continue" | |
| for ($batch = $Start; $batch -le $Stop; $batch += $Step) { | |
| Write-Host "Trying per-GPU batch=$batch" | |
| powershell -ExecutionPolicy Bypass -File scripts/train_2gpu.ps1 -Config $Config -BatchSize $batch -Epochs 1 | |
| if ($LASTEXITCODE -ne 0) { | |
| Write-Host "Failed at per-GPU batch=$batch. Use the previous successful value." | |
| exit 0 | |
| } | |
| } | |