Metadata-Version: 2.4
Name: systolic-drift
Version: 1.1.1
Summary: Numerical reliability and diagnostics for LLM execution: systolic-array arithmetic simulation, block-scaled formats (MXFP4, MXFP8, NVFP4), paper-derived accumulator models, model-level numerical impact, batch-invariance analysis, cost/accuracy mitigation studies and log-probability conformance audits
Author: Bhargav Kumar Nath
License-Expression: MIT
Project-URL: Homepage, https://github.com/BhargavKumarNath/SystolicDrift-Reliability
Project-URL: Documentation, https://github.com/BhargavKumarNath/SystolicDrift-Reliability/tree/main/docs
Project-URL: Changelog, https://github.com/BhargavKumarNath/SystolicDrift-Reliability/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/BhargavKumarNath/SystolicDrift-Reliability/issues
Keywords: llm,numerics,floating-point,quantization,mxfp4,fp8,reproducibility,pytorch,inference,systolic-array
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: torch>=2.1
Requires-Dist: transformers>=4.40
Requires-Dist: matplotlib>=3.8
Dynamic: license-file

# SystolicDrift Reliability

SystolicDrift measures how arithmetic choices (operand format, accumulator precision, reduction order, batch shape, execution path) change the numerics of LLM inference. All arithmetic is software emulation on CPU or MPS. No result is a hardware measurement.

## Try it

Needs Python 3.10 or newer. The demo builds a small random-weight model in memory, so no model is downloaded:

```bash
pip install systolic-drift
systolic-drift demo --html
```

Its numbers show what each experiment produces. They are not findings, because the weights are random.

## Commands

| Command | Question |
| --- | --- |
| `audit` | How far do per-token log-probs move between execution paths? |
| `batch-audit` | Is a request bitwise invariant to batch, padding and chunked prefill? |
| `impact`, `study` | How do operand formats and accumulators change projections and logits? |
| `mitigate` | What is the cheapest evaluated mixed-precision plan within an error budget? |
| `simulate`, `ablation` | How do systolic dataflow and loop order change matmul drift? |
| `report`, `reproduce`, `diff` | Render, re-run and compare result directories |

Model experiments support Llama-family checkpoints.

## Documentation

- [Repository and measured results](https://github.com/BhargavKumarNath/SystolicDrift-Reliability)
- [Getting started](https://github.com/BhargavKumarNath/SystolicDrift-Reliability/blob/main/docs/getting-started.md)
- [Bring your own model](https://github.com/BhargavKumarNath/SystolicDrift-Reliability/blob/main/docs/bring-your-own-model.md)
- [CLI reference](https://github.com/BhargavKumarNath/SystolicDrift-Reliability/blob/main/docs/cli-reference.md)
- [Changelog](https://github.com/BhargavKumarNath/SystolicDrift-Reliability/blob/main/CHANGELOG.md)
