<commit_before># Building a quantization paradigm from first principles

**TLDR:** If you prefer example code over theory, look at
[doc/quantization_example.cc](quantization_example.cc).

## Overview

gemmlowp allows to perform calculations on matrices on uint8 values, but these
matrices are only useful insofar as they somehow approximate matrices of real
numbers. By a _quantization paradigm_ we mean a correspondence between matrices
of quantized 8bit values and matrices of real numbers. The choice of a
quantization paradigm affects the calculations that gemmlowp itself needs to
perform, specifically, it affects how one goes from internal 32bit accumulator
to final 8bit outputs.

The part of gemmlowp transforming internal internal 32bit accumulator to final
8bit outputs is the "output pipeline" described in [output.md](output.md).

gemmlowp's `GemmWithOutputPipeline` entry point allows specifying an arbitrary
output pipeline, allowing the user to implement their own preferred quantized<commit_msg>Fix typo<commit_after># Building a quantization paradigm from first principles

**TLDR:** If you prefer example code over theory, look at
[doc/quantization_example.cc](quantization_example.cc).

## Overview

gemmlowp allows to perform calculations on matrices on uint8 values, but these
matrices are only useful insofar as they somehow approximate matrices of real
numbers. By a _quantization paradigm_ we mean a correspondence between matrices
of quantized 8bit values and matrices of real numbers. The choice of a
quantization paradigm affects the calculations that gemmlowp itself needs to
perform, specifically, it affects how one goes from internal 32bit accumulator
to final 8bit outputs.

The part of gemmlowp transforming internal 32bit accumulator to final
8bit outputs is the "output pipeline" described in [output.md](output.md).

gemmlowp's `GemmWithOutputPipeline` entry point allows specifying an arbitrary
output pipeline, allowing the user to implement their own preferred quantized
{'fraction_non_alphanumeric': 0.03880597014925373, 'fraction_numerical': 0.007960199004975124, 'mean_word_length': 5.816949152542373, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1026475', 'n_tokens_mistral': 506, 'n_tokens_neox': 465, 'n_words': 263}