4 ms·
There's an explanation here: https://www.chessprogramming.org/Stockfish_NNUE https://www.chessprogramming.org/Stockfish_NNUE It uses clever integer arithmetic
by bitshiftfaced 6y ago
There's an explanation here: https://www.chessprogramming.org/Stockfish_NNUE https://www.chessprogramming.org/Stockfish_NNUE
It uses clever integer arithmetic in the neural network, so you don't need a monster GPU to get good performance. I believe as of now it's using both the nn and the classic heuristic-based system for different situations.
- krick 6y agoIt doesn't answer any of my questions, though. In the end, it doesn't matter how exactly that NN works, in terms of architecture, weights, framework, etc. Given there is a common API, one position evaluation module can be used as a drop-in-replacement for some other implementation of position evaluation module. I mean, it kinda made sense that Leela was a different project, because it wasn't clear back then if a community will be able to train an NN which can surpass heuristics-based engine, and heuristics was at the heart of Stockfish. But if it turns out to be that heuristics-based approach has lost to NN, it isn't that clear anymore why these have to be 2 separate projects. At least, in terms of the rest of the engine. > I believe as of now it's using both the nn and the classic heuristic-based system for different situations. That's what I'm actually curious about. How does it combine these 2, precisely? Edit: actually, reading more carefully the "Hybrid" section it kind of answers the last question. But still makes me wonder if the rest of the 2 engines cannot be combined.
- oli5679 6y agoStockfish has two key components: (1) an evaluation function, that quantifies black/white advantage in a chess position. (2) a search algorithm, that iteratively checks move sequences from a starting position using (1) and returns a recommendation of the best move to play. Historically (1) was handcrafted, but it recently switched to a 'NNUE' neural network architecture (now it using different evaluation functions depending on how balanced the position is). This is a good video if you want to understand how Stockfish works. https://www.youtube.com/watch?v=pUyURF1Tqvg https://www.youtube.com/watch?v=pUyURF1Tqvg "But if it turns out to be that heuristics-based approach has lost to NN, it isn't that clear anymore why these have to be 2 separate projects. At least, in terms of the rest of the engine." Leela's evaluation function is a deep neural network, inference can only be carried out efficiently using GPU, whilst the Stockfish system has been optimised for a CPU-based computer architecture. The innovation of NNUE is that inference can be performed efficiently on a CPU, partly because the network is much smaller, and partly because the architecture is designed to be efficient at recomputing evaluations of only a single piece has changed.