Skip to content

Repository files navigation

SmolLM2 CPU Conformance

Numerical qualification for pinned HuggingFaceTB/SmolLM2-135M weights on CPU. The study compares a custom full-sequence path, a separately implemented incremental K/V-cache path, and Transformers eager execution.

Result

Check Result
Forward cases 48 / 48 passed
Layer comparisons 1,440
Top-1 disagreements 0
Greedy tokens matched 24 / 24
Full path vs. Transformers, max relative logit L2 6.37e-7
Incremental vs. full, max relative logit L2 5.04e-6
Injected faults localized at the first affected layer 7 / 7

This is a float32 CPU correctness result for one model revision. It makes no GPU, speed, serving, model-quality, or production claim.

Verify

Use Python 3.12 in an isolated environment:

python -m pip install -r requirements.txt
python tools/fetch_model.py
python tools/verify_project.py

The fetch is about 273 MB and writes only to ignored .cache/model. Every model file is checked by size and SHA256 before loading. The full gate runs 14 tests, verifies the canonical hashes and frozen provenance, independently replays selected logits and tokens, and rebuilds the study on the local host. A portable rebuild must preserve the contract, case matrix, token decisions, and fault localization while satisfying every numerical threshold. Host provenance and floating-point bytes are not required to match across CPU platforms.

Raw cases, layer checkpoints, generations, controlled defects, model identity, and file hashes are under artifacts/canonical-v1. The frozen design and limitations are in METHODS.md.

About

Reproducible CPU numerical conformance study for SmolLM2-135M full-sequence and incremental KV-cache execution.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages