Accumulate clipping statistics to a 64 bit integer to prevent overflow for larger batch sizes.

This commit is contained in:
Tomasz Sobczyk
2020-12-24 13:30:04 +01:00
committed by nodchip
parent 1b560efabd
commit acf95c7c98
2 changed files with 4 additions and 8 deletions

View File

@@ -295,8 +295,6 @@ namespace Eval::NNUE {
// number of samples in mini-batch
IndexType batch_size_;
IndexType num_total_;
const LearnFloatType* input_;
// Trainer of the previous layer
@@ -316,8 +314,8 @@ namespace Eval::NNUE {
// Health check statistics
LearnFloatType min_activations_[kOutputDimensions];
LearnFloatType max_activations_[kOutputDimensions];
IndexType num_clipped_;
IndexType num_total_;
uint64_t num_clipped_;
uint64_t num_total_;
ThreadState() { reset(); }

View File

@@ -690,8 +690,6 @@ namespace Eval::NNUE {
// layer to learn
LayerType* const target_layer_;
IndexType num_total_;
// parameter
alignas(kCacheLineSize) LearnFloatType biases_[kHalfDimensions];
alignas(kCacheLineSize)
@@ -717,8 +715,8 @@ namespace Eval::NNUE {
alignas(kCacheLineSize) LearnFloatType max_activations_[kHalfDimensions];
LearnFloatType min_pre_activation_;
LearnFloatType max_pre_activation_;
IndexType num_clipped_;
IndexType num_total_;
uint64_t num_clipped_;
uint64_t num_total_;
ThreadStatState() { reset(); }