Clean up and simplify some nnue code.

Remove some unnecessary code and it's execution during inference. Also the change on line 49 in nnue_architecture.h results in a more efficient SIMD code path through ClippedReLU::propagate().

passed STC:
https://tests.stockfishchess.org/tests/view/6217d3bfda649bba32ef25d5
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 12056 W: 3281 L: 3092 D: 5683
Ptnml(0-2): 55, 1213, 3312, 1384, 64

passed STC SMP:
https://tests.stockfishchess.org/tests/view/6217f344da649bba32ef295e
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 27376 W: 7295 L: 7137 D: 12944
Ptnml(0-2): 52, 2859, 7715, 3003, 59

closes https://github.com/official-stockfish/Stockfish/pull/3944

No functional change

bench: 6820724
This commit is contained in:
mstembera
2022-02-23 18:19:36 -08:00
committed by Joost VandeVondele
parent 27139dedac
commit 5f781d366e
6 changed files with 27 additions and 32 deletions
+2 -2
View File
@@ -127,11 +127,11 @@ namespace Stockfish::Eval::NNUE {
{
for (; i + 1 < sizeof(IntType); ++i)
{
u[i] = v;
u[i] = (std::uint8_t)v;
v >>= 8;
}
}
u[i] = v;
u[i] = (std::uint8_t)v;
stream.write(reinterpret_cast<char*>(u), sizeof(IntType));
}