Using LC0 with one or two GPUs - a guide
Posted: Sat Mar 30, 2019 10:48 am
Cos it came up repeatedly, here a short guide what to consider when using one or
two gpus with LC0.
Hardware:
- CPU or GPU?
LC0 uses neural networks for evaluation of chess positions, these are
commpute and memory intensive, ideally for being accelerated by an gpu.
To add an discrete gpu to your PC you will need an free PCI Express slot,
and a power supply unit that can serve the additional power consumption.
Note that gpus need commonly two free slots in your PC case.
- AMD or Nvidia?
LC0 is able to run on CPUs and on GPUs via OpenCL and on Nvidia GPUs via CUDA
and cuDNN. Currently the Nvidia CUDA and cuDNN backend outperforms AMD OpenCL
backend by a wide margin. Of course this may change in the future.
See these benchs for some numbers:
https://www.phoronix.com/scan.php?page= ... Benchmarks
https://www.phoronix.com/scan.php?page= ... inux&num=9
- Nvidia RTX or GTX?
The Nvidia RTX series has TensorCores onboard, which accelerates the neural
network of LC0 significantly, of course for an higher price.
- Two or one GPUs?
An additional gpu gives est. about +50 Elo. You can mix different gpus with LC0.
- Thermal issues
A highend gpu produces about 300 Watts thermal power under load, so you may
have to add some additional fans in your PC case for cooling. An alternative
is a water cooling solution. See also:
viewtopic.php?f=2&t=70097
Software:
- FP16 (half precision) or FP32 (single precision)?
Neural network inference is currently done via floating point computation.
Some gpus offer higher instruction throughput with lower precision, so on
these devices FP16 (half precision) can pay off. Nvidia RTX series for
example offer FP16 optimized computation in LC0.
- Which parameters to choose?
LC0 has some tuneable params to get more nps, for example backend type, number
of threads, nncache or batch size. Consider this sheet for different params
and nps:
https://docs.google.com/spreadsheets/d/ ... CjBILe6uA/
- Which network to choose?
LC0 is still under development, and network design may change, so there are
a bunch of different networks which give different nps and Elo. Here an
overview of different networks LC0 offers:
http://www.lczero.org/networks/
--
Srdja
two gpus with LC0.
Hardware:
- CPU or GPU?
LC0 uses neural networks for evaluation of chess positions, these are
commpute and memory intensive, ideally for being accelerated by an gpu.
To add an discrete gpu to your PC you will need an free PCI Express slot,
and a power supply unit that can serve the additional power consumption.
Note that gpus need commonly two free slots in your PC case.
- AMD or Nvidia?
LC0 is able to run on CPUs and on GPUs via OpenCL and on Nvidia GPUs via CUDA
and cuDNN. Currently the Nvidia CUDA and cuDNN backend outperforms AMD OpenCL
backend by a wide margin. Of course this may change in the future.
See these benchs for some numbers:
https://www.phoronix.com/scan.php?page= ... Benchmarks
https://www.phoronix.com/scan.php?page= ... inux&num=9
- Nvidia RTX or GTX?
The Nvidia RTX series has TensorCores onboard, which accelerates the neural
network of LC0 significantly, of course for an higher price.
- Two or one GPUs?
An additional gpu gives est. about +50 Elo. You can mix different gpus with LC0.
- Thermal issues
A highend gpu produces about 300 Watts thermal power under load, so you may
have to add some additional fans in your PC case for cooling. An alternative
is a water cooling solution. See also:
viewtopic.php?f=2&t=70097
Software:
- FP16 (half precision) or FP32 (single precision)?
Neural network inference is currently done via floating point computation.
Some gpus offer higher instruction throughput with lower precision, so on
these devices FP16 (half precision) can pay off. Nvidia RTX series for
example offer FP16 optimized computation in LC0.
- Which parameters to choose?
LC0 has some tuneable params to get more nps, for example backend type, number
of threads, nncache or batch size. Consider this sheet for different params
and nps:
https://docs.google.com/spreadsheets/d/ ... CjBILe6uA/
- Which network to choose?
LC0 is still under development, and network design may change, so there are
a bunch of different networks which give different nps and Elo. Here an
overview of different networks LC0 offers:
http://www.lczero.org/networks/
--
Srdja