train: value network trainer on Lc0 data
A bullet trainer for a (768 -> 128)x2 -> 1 SCReLU value network, reading linrock's Lc0-derived Stockfish binpacks directly (no conversion). The target blends the game result (0.4) with the search score; 40 superbatches by default, about 12 minutes on an RTX 3070. train/value/train.ps1 sets up CUDA 13.3 and cargo, unpacks the default binpack if needed, builds and runs. train/README.md documents the data, the setup and the network file layout for the engine side. No engine change. Bench: 546127 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
241ad4a546
commit
530c4d67ed
6 files changed
+844
No files matched your search
@@ -0,0 +1,36 @@
|
||||
# Trains Rigby's value network. Run from anywhere:
|
||||
# powershell -ExecutionPolicy Bypass -File C:\Users\rektd\repos\Rigby\train\value\train.ps1
|
||||
# Extra arguments go to the trainer, e.g.:
|
||||
# ... train.ps1 --superbatches 60 --id rigby-value-v2
|
||||
# ... train.ps1 --data ..\data\a.binpack --data ..\data\b.binpack
|
||||
param([Parameter(ValueFromRemainingArguments = $true)] [string[]] $TrainerArgs)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
Set-Location $PSScriptRoot
|
||||
|
||||
# CUDA 13.3 (the toolkit bullet links against) and cargo
|
||||
$env:CUDA_PATH = 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.3'
|
||||
$env:PATH = "$env:USERPROFILE\.cargo\bin;$env:CUDA_PATH\bin\x64;$env:PATH"
|
||||
|
||||
# The bullet clone the trainer builds against
|
||||
if (-not (Test-Path '..\..\..\bullet\crates\bullet_lib')) {
|
||||
throw 'bullet not found next to the Rigby repo: git clone https://github.com/jw1912/bullet C:\Users\rektd\repos\bullet'
|
||||
}
|
||||
|
||||
# Default data: unpack the .zst once if only the compressed file is there
|
||||
$data = '..\data\test80-2024-02-feb-2tb7p.min-v2.v6.binpack'
|
||||
if (-not ($TrainerArgs -contains '--data') -and -not (Test-Path $data)) {
|
||||
if (-not (Test-Path "$data.zst")) { throw "No training data: $data(.zst) is missing" }
|
||||
Write-Host "Unpacking $data.zst ..."
|
||||
$src = (Resolve-Path "$data.zst").Path
|
||||
python -P -c "import zstandard,sys,os; s=sys.argv[1]; d=s[:-4]; zstandard.ZstdDecompressor().copy_stream(open(s,'rb'), open(d+'.part','wb'), read_size=1<<24, write_size=1<<24); os.replace(d+'.part', d)" $src
|
||||
}
|
||||
|
||||
cargo build --release
|
||||
if ($LASTEXITCODE -ne 0) { throw 'build failed' }
|
||||
|
||||
& .\target\release\rigby-value.exe @TrainerArgs
|
||||
if ($LASTEXITCODE -ne 0) { throw "training failed ($LASTEXITCODE)" }
|
||||
|
||||
Write-Host ''
|
||||
Write-Host 'Done. Networks are in' (Resolve-Path .\checkpoints).Path
|
||||
Reference in new issue
Block a user