Requantize smallnet to nn-47fc8b7fff06.nnue

Passed Non-regression STC:
LLR: 3.01 (-2.94,2.94) <-1.75,0.25>
Total: 340384 W: 88165 L: 88274 D: 163945
Ptnml(0-2): 1145, 40248, 87571, 40027, 1201
https://tests.stockfishchess.org/tests/view/69a4c49ab4a714eaaa196bc0

Passed Non-regression LTC:
LLR: 2.97 (-2.94,2.94) <-1.75,0.25>
Total: 125922 W: 32222 L: 32106 D: 61594
Ptnml(0-2): 100, 13815, 35002, 13957, 87
https://tests.stockfishchess.org/tests/view/69a9d5f489704e42c5e3a35d

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

Bench: 2171643
This commit is contained in:
Shawn Xu
2026-03-07 22:20:46 +01:00
committed by Joost VandeVondele
parent 8b6d8def30
commit 2907ee1a90
2 changed files with 7 additions and 24 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ namespace Eval {
// name of the macro or the location where this macro is defined, as it is used
// in the Makefile/Fishtest.
#define EvalFileDefaultNameBig "nn-9a0cc2a62c52.nnue"
#define EvalFileDefaultNameSmall "nn-37f18f62d772.nnue"
#define EvalFileDefaultNameSmall "nn-47fc8b7fff06.nnue"
namespace NNUE {
struct Networks;
+6 -23
View File
@@ -155,13 +155,6 @@ class FeatureTransformer {
permute<8>(threatWeights, InversePackusEpi16Order);
}
inline void scale_weights(bool read) {
for (auto& w : weights)
w = read ? w * 2 : w / 2;
for (auto& b : biases)
b = read ? b * 2 : b / 2;
}
// Read network parameters
bool read_parameters(std::istream& stream) {
read_leb_128(stream, biases);
@@ -182,9 +175,6 @@ class FeatureTransformer {
permute_weights();
if constexpr (!UseThreats)
scale_weights(true);
return !stream.fail();
}
@@ -194,9 +184,6 @@ class FeatureTransformer {
copy->unpermute_weights();
if constexpr (!UseThreats)
copy->scale_weights(false);
write_leb_128<BiasType>(stream, copy->biases);
if constexpr (UseThreats)
@@ -288,7 +275,7 @@ class FeatureTransformer {
constexpr IndexType NumOutputChunks = HalfDimensions / 2 / OutputChunkSize;
const vec_t Zero = vec_zero();
const vec_t One = vec_set_16(UseThreats ? 255 : 127 * 2);
const vec_t One = vec_set_16(255);
const vec_t* in0 = reinterpret_cast<const vec_t*>(&(accumulation[perspectives[p]][0]));
const vec_t* in1 =
@@ -408,18 +395,14 @@ class FeatureTransformer {
if constexpr (UseThreats)
{
BiasType sum0t = threatAccumulation[static_cast<int>(perspectives[p])][j + 0];
BiasType sum1t =
sum0 += threatAccumulation[static_cast<int>(perspectives[p])][j + 0];
sum1 +=
threatAccumulation[static_cast<int>(perspectives[p])][j + HalfDimensions / 2];
sum0 = std::clamp<BiasType>(sum0 + sum0t, 0, 255);
sum1 = std::clamp<BiasType>(sum1 + sum1t, 0, 255);
}
else
{
sum0 = std::clamp<BiasType>(sum0, 0, 127 * 2);
sum1 = std::clamp<BiasType>(sum1, 0, 127 * 2);
}
sum0 = std::clamp<BiasType>(sum0, 0, 255);
sum1 = std::clamp<BiasType>(sum1, 0, 255);
output[offset + j] = static_cast<OutputType>(unsigned(sum0 * sum1) / 512);
}