Skip to content

v1.0.0: Measured CPU quantization tradeoffs

Latest

Choose a tag to compare

@lucioduran lucioduran released this 09 Nov 20:35

Real local CPU quantization of sentence-transformers/paraphrase-MiniLM-L3-v2, pinned revision 4ca70771034acceecb2e72475f72050fcdde4ddc, with PyTorch 2.2.2 dynamic qint8 Linear kernels.

Final commit: b122cfb.
CI: https://github.com/lucioduran/quantization-quality-lab/actions/runs/42694246947.

Measured November 9, 2026 on Intel Xeon W-3223, macOS x86_64, 48 GiB RAM, two intra-op threads. Preparation and all six workers ran under the shared exclusive lock. Full raw vectors, timings, rankings, token counts, memory observations, model hashes and environment metadata are in evidence/.

  • Serialized weights: 69,576,640 to 53,223,452 bytes, 23.5% smaller.
  • Median warm speedups: 1.53x, 1.05x and 1.12x at 32, 64 and 128 tokens.
  • Median RSS after load rises from 355.22 to 404.26 MiB. Int8 p95 is worse at 64 and 128 tokens.
  • Held-out top-1 accuracy remains 19/24 at 32 and 64 tokens and 21/24 at 128 tokens.
  • The long4 query worsens from rank 6 to 8 at 32 tokens and 7 to 8 at 64 tokens. Numerical drift and all first-call outliers are retained.

Validation: 31 tests, Ruff lint and formatting, strict mypy for the replay layer, full offline evidence replay, source/wheel build, and wheel-only installed-command smoke test. The initial CI environment failure and fix are recorded in docs/validation.md.

Lightweight offline replay after extracting the source distribution, using Python 3.11.13:

PYTHONPATH=src python3 -m quantization_quality_lab.cli verify

The wheel has no runtime dependencies; pass --root to a source checkout or extracted source distribution containing evidence. SHA256SUMS covers both attached distributions. Model weights are not included. The README documents their exact creation recipe and the required shared lock infrastructure for full measurement.

Scope: one CPU host, one small model, 24 held-out synthetic queries, batch-one synthetic timing inputs, and three workers per mode. RSS includes construction and allocator retention. Only the first 32-token call is process-cold. Replay establishes consistency, not authenticity. No GPU, generation, production generalization, or measured energy-cost claim. Code, fixtures and evidence are MIT; the separately downloaded model is Apache-2.0. Free local resources only.