official-stockfish/nnue-pytorch

Stockfish NNUE (Chess evaluation) trainer in Pytorch

What it solves

This project provides a PyTorch-based framework for training NNUE (Efficiently Updatable Neural Networks) used in the Stockfish chess engine. It allows developers to train high-performance evaluation networks that can be integrated into the engine to improve its chess-playing strength.

How it works

The project uses PyTorch to implement the training pipeline. It supports various hardware accelerations, including NVIDIA GPUs (CUDA), AMD GPUs (ROCm), and Apple Silicon (MPS), as well as CPU-only testing. It utilizes a fast sparse data loader to handle the large datasets required for training these networks.

Who it’s for

Chess engine developers and researchers interested in training custom evaluation networks for Stockfish.

Highlights

  • Support for multiple GPU backends (NVIDIA, AMD, Apple Silicon).
  • Docker-based setup to simplify environment configuration and the C++ compilation process.
  • Integration with a fast sparse data loader for efficient training.
  • Support for reproducible training and engine testing workflows.

Related

  • Project
  • Project
  • Project
  • Project
  • Project