Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ Sykora is tested by [CCRL](https://computerchess.org.uk/ccrl/404/). Current entr
<summary><b>Evaluation</b>: NNUE (default) with classical fallback</summary>

- **NNUE evaluation** (default, embedded in binary):
- `SYKNNUE3` and `SYKNNUE4` network loading
- Legacy `768 -> Nx2 -> 1` and mirrored king-bucketed sparse-input nets
- `SYKNNUE5` material-output-bucket nets, with compatibility for the current embedded net
- Mirrored king-bucketed sparse-input nets
- SCReLU activation with incremental accumulators during search
- Trained on high-depth self-play data via the Bullet trainer
- King-bucket training path via `nnue/bullet_repo/examples/sykora_bucketed.rs`
Expand Down Expand Up @@ -260,7 +260,7 @@ See `history/README.md` for folder schema and the archived workflow.

## NNUE

Sykora supports both legacy `768 -> Nx2 -> 1` nets and mirrored king-bucketed nets with dual-perspective accumulator updates and SCReLU activation. The engine can load both `SYKNNUE3` and `SYKNNUE4` files.
Sykora's current training target is `SYKNNUE5`: mirrored king-bucketed sparse inputs with dual-perspective accumulator updates, SCReLU activation, and material-count output buckets. The engine still keeps loader compatibility for the current embedded net until `src/net.sknnue` is replaced.

### Runtime

Expand All @@ -270,7 +270,7 @@ Sykora supports both legacy `768 -> Nx2 -> 1` nets and mirrored king-bucketed ne
- To use a different net, set `EvalFile` to the path of an external `.sknnue` file.
- `NnueScale` scales the NNUE score before it is fed into the search.

For exact file-format details, see [specs/syknnue4_spec.md](specs/syknnue4_spec.md) and `src/nnue.zig`.
For exact file-format details, see [specs/syknnue5_spec.md](specs/syknnue5_spec.md) and `src/nnue.zig`.

### Training Pipeline

Expand All @@ -284,8 +284,9 @@ python utils/nnue/bullet/train_cuda_longrun.py \
--data-format binpack \
--bullet-repo nnue/bullet_repo \
--output-root nnue/models/bullet \
--network-format syk3 \
--hidden 256 --end-superbatch 320 --threads 8
--network-format syk5 \
--bucket-layout sykora16 \
--hidden 512 --end-superbatch 320 --threads 8
```

**Using BulletFormat .data files:**
Expand All @@ -295,8 +296,9 @@ python utils/nnue/bullet/train_cuda_longrun.py \
--dataset nnue/data/bullet/train/train_main.data \
--bullet-repo nnue/bullet_repo \
--output-root nnue/models/bullet \
--network-format syk3 \
--hidden 256 --end-superbatch 320 --threads 8
--network-format syk5 \
--bucket-layout sykora16 \
--hidden 512 --end-superbatch 320 --threads 8
```

**Multiple datasets** can be passed space-separated:
Expand All @@ -319,16 +321,15 @@ python utils/nnue/bullet/train_cuda_longrun.py \
...
```

**Training a `SYKNNUE4` baseline:**
**Training a `SYKNNUE5` material-output-bucket net:**

```bash
python utils/nnue/bullet/train_cuda_longrun.py \
--dataset data/training.binpack \
--data-format binpack \
--network-format syk4 \
--network-format syk5 \
--bucket-layout sykora16 \
--hidden 1536 \
--dense-l1 16 --dense-l2 32 \
--hidden 512 \
--end-superbatch 320 --threads 8
```

Expand All @@ -343,15 +344,15 @@ Sykora can generate its own training data via the `gensfen` command:

### Exporting a Trained Net

Export a `SYKNNUE4` checkpoint:
Export a `SYKNNUE5` checkpoint:

```bash
python utils/nnue/bullet/checkpoint_raw_to_npz.py \
--input nnue/models/bullet/<run_id>/checkpoints/<checkpoint> \
--output checkpoint_syk4.npz
--output checkpoint_syk5.npz

python utils/nnue/bullet/export_npz_to_syk4.py \
--input checkpoint_syk4.npz \
python utils/nnue/bullet/export_npz_to_syk5.py \
--input checkpoint_syk5.npz \
--output-net output.sknnue
```

Expand Down Expand Up @@ -379,7 +380,7 @@ python utils/nnue/bullet/gate_checkpoints.py \

This gate now evaluates recent checkpoints by selfplay only. STS is intentionally not part of the checkpoint promotion path.

SYKNNUE4 design spec: `specs/syknnue4_spec.md`.
SYKNNUE5 design spec: `specs/syknnue5_spec.md`.

## Contributing

Expand Down
17 changes: 10 additions & 7 deletions launch_training.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sykora NNUE V4 Training Launch Script
# Sykora NNUE V5 Training Launch Script
# Run from project root: .\launch_training.ps1
#
# Dataset: T80-2023 (jun-dec) + T80-2024 (jan-jun) .min-v2.v6 binpacks
Expand Down Expand Up @@ -60,19 +60,20 @@ foreach ($bp in $binpacks) {
}

# --- Training Parameters ---
# SYKNNUE4 baseline:
# mirrored king buckets (sykora16) -> FT 768 -> shared linear output
$networkFormat = "syk4"
# SYKNNUE5:
# mirrored king buckets (sykora16) -> FT 512 -> 8 material-count output heads
$networkFormat = "syk5"
$bucketLayout = "sykora16"
$hidden = 768
$hidden = 512
$outputBuckets = 8
$endSuperbatch = 600
$lrStart = 0.001
$wdl = 0.25
$saveRate = 10
$threads = 8

Write-Host "============================================"
Write-Host " Sykora NNUE V4 Training (RTX 4070 Ti SUPER)"
Write-Host " Sykora NNUE V5 Training (RTX 4070 Ti SUPER)"
Write-Host "============================================"
Write-Host "Data: T80-2023/2024 filtered set"
Write-Host "Filtering: .min-v2.v6 on T80 inputs"
Expand All @@ -81,7 +82,8 @@ Write-Host "Format: binpack (sfbinpack)"
Write-Host "Net format: $networkFormat"
Write-Host "Bucket layout: $bucketLayout"
Write-Host "FT hidden: $hidden"
Write-Host "Dense head: linear $($hidden * 2) -> 1"
Write-Host "Output heads: $outputBuckets material-count buckets"
Write-Host "Dense head: bucketed linear $($hidden * 2) -> 1"
Write-Host "Superbatches: 1 -> $endSuperbatch"
Write-Host "Save rate: every $saveRate superbatches"
Write-Host "Threads: $threads"
Expand All @@ -104,6 +106,7 @@ python "$PSScriptRoot\utils\nnue\bullet\train_cuda_longrun.py" `
--network-format $networkFormat `
--bucket-layout $bucketLayout `
--hidden $hidden `
--output-buckets $outputBuckets `
--end-superbatch $endSuperbatch `
--save-rate $saveRate `
--threads $threads `
Expand Down
Loading