Skip to content

Commit

Permalink
Merge pull request #264 from Sopel97/reqtxt
Browse files Browse the repository at this point in the history
Add complete requirements.txt. Update readme on the installation process.
  • Loading branch information
vondele authored Sep 22, 2023
2 parents cfbc975 + 78c88af commit a6a05b8
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 19 deletions.
52 changes: 33 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,44 @@
# Setup

#### Install PyTorch
### Software prerequisites

[PyTorch installation guide](https://pytorch.org/get-started/locally/)
#### Python

```
python3 -m venv env
source env/bin/activate
pip install python-chess==0.31.4 pytorch-lightning==1.9.5 torch matplotlib tensorboard
```
If using easy_train.py then at least 3.7 is required.

Otherwise versions around 3.6 should also work, but updating is recommended.

Python 3.11 was also tested and works well.

#### A C++ compiler

If you're using easy_train.py then at least GCC 9.2 is required for compiling the data loader, Stockfish, and c-chess-cli. This a defensive version requirement as older versions were known to cause problems with Stockfish.

If you're not using easy_train.py then no automatic compilation will take place; use what you wish.

If you're on Windows the best way is to probably use [MSYS2](https://www.msys2.org/). It would also make it easy to install Make (next step).

#### Make

For compiling Stockfish and c-chess-cli. Not strictly necessary if you're not using easy_train.py, but recommended.

#### CMake

Necessary for compiling the data loader.

https://cmake.org/install/

### Package dependencies

#### Install CuPy
First check what version of cuda is being used by pytorch.
```
import torch
torch.version.cuda
```
Then install CuPy with the matching CUDA version.
```
pip install cupy-cudaXXX
python -m venv trainer
pip install -r requirements.txt
```
where XXX corresponds to the first 3 digits of the CUDA version. For example `cupy-cuda112` for CUDA 11.2.

CuPy might use the PyTorch's private installation of CUDA, but it is better to install the matching version of CUDA separately. [CUDA Downloads](https://developer.nvidia.com/cuda-downloads)
PyTorch with CUDA 11.8 will be automatically installed, along with the matching CuPy version.

### The data loader (if not using easy_train.py)

#### Build the fast DataLoader
This requires a C++17 compiler and cmake.

Windows:
Expand Down Expand Up @@ -71,4 +85,4 @@ This script runs in a loop, and will monitor the directory for new checkpoints.
* syzygy - http://www.talkchess.com/forum3/viewtopic.php?f=7&t=75506
* https://github.com/DanielUranga/TensorFlowNNUE
* https://hxim.github.io/Stockfish-Evaluation-Guide/
* dkappe - Suggesting ranger (https://github.com/lessw2020/Ranger-Deep-Learning-Optimizer)
* dkappe - Suggesting ranger (https://github.com/lessw2020/Ranger-Deep-Learning-Optimizer)
11 changes: 11 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
psutil
asciimatics
GPUtil
python-chess==0.31.4
matplotlib
--find-links https://download.pytorch.org/whl/torch_stable.html
torch==2.0.1+cu118
pytorch-lightning==1.9.5
tensorboard
cupy-cuda11x
numba

0 comments on commit a6a05b8

Please sign in to comment.