Skip to main content

FaultForge

A framework for running reproducible hardware fault-injection experiments on PyTorch models - with error-corrected memory reliability testing built in as its first experiment.

Highlights

  • A reusable experiment framework (Experiment): automatic run loops, statistical stop conditions (run until a stable mean, a fixed count, or Ctrl+C), and atomic, resumable, optionally zstd-compressed saving.
  • Fingerprint-based verification: resuming or comparing a saved result against a changed configuration fails loudly with a precise diff, instead of silently mixing incompatible data.
  • A generic and extensible system for reliabilty metrics.
  • A composable encoding framework (Encoder/Encoding, chainable via EncoderSequence) with three built-in ECC-style techniques - SECDED (Hamming codes), MSET, and CEP - usable standalone or combined.
  • An explicit fault model (bit flips and stuck-at faults) with a resumable, repeat-free fault-location sampler, and a batched injection API built for performance.
  • One ready-made experiment today, encoded_memory: fault injection into ECC-protected model parameters, with built-in CIFAR-10/100 and ImageNet model/dataset loading and a CLI for recording and plotting results. It doubles as the reference implementation to follow when adding a new experiment.
  • Performance-critical bit-buffer, encoding, and fault-injection logic is implemented in Rust and exposed to Python via PyO3.

Installation

Prebuilt packages from PyPI

Using pip:

pip install faultforge

Using uv:

uv add faultforge

faultforge is the only package published to PyPI - it's the framework only, with no CLI and no ready-made experiments.

Installing from source

Building from source requires a Rust toolchain. Install one with your system package manager or via rustup. This repository's root package is the faultforge library. Point pip at whichever revision you want:

# latest release (the latest branch tracks the most recent tagged release)
pip install 'faultforge @ git+https://github.com/rezzubs/faultforge.git@latest'

# a specific released version
pip install 'faultforge @ git+https://github.com/rezzubs/faultforge.git@v0.2.1'

# a specific commit
pip install 'faultforge @ git+https://github.com/rezzubs/faultforge.git@<commit-sha>'

# development (main is kept in sync with the newest code, can break at any point)
pip install 'faultforge @ git+https://github.com/rezzubs/faultforge.git'

Ready-made experiments (see Experiments below) aren't published to PyPI - install one the same way, pointed at its own subdirectory under experiments/ See each experiment's README for details.

Quick example

from encoded_memory import (
    EncodedFaultInjection,
    ReliabilityMetric,
)
from faultforge.encoding import SecdedEncoder
from faultforge.experiment import MaxRuns
from faultforge.loading import Cifar, CifarDataset, CifarModel

bundle = Cifar(model=CifarModel.ResNet20, dataset=CifarDataset.Cifar10)
encoder = SecdedEncoder(bits_per_chunk=64)

experiment = EncodedFaultInjection(
    bundle,
    encoder,
    ReliabilityMetric.Accuracy,
    faults=1e-3,  # a bit error rate; pass an int instead for an exact fault count
)
experiment.run_loop(stop_conditions=[MaxRuns(total=20)])

print("Mean accuracy:", experiment.mean_score())

See docs/library.md for a full walkthrough of the framework's pieces and how they compose.

Experiments

Ready-made experiments live under experiments/ as their own packages, each pinned to a specific faultforge version rather than tracking main. There's one today, serving as the reference implementation for adding your own:

  • Encoded Memory - fault injection into ECC-protected model parameters, covering the available encoding techniques, the encoded-memory CLI, and using the experiment directly as a library.

Citation

Encoded Memory

There are two papers related to the encoded memory experiment.

Paper in DATE 2026

Introduced the MSET technique as a zero cost alternative to ECCs.

@inproceedings{ahmadilivani2026late,
  title={Late Breaking Results: Uncovering the Limits of ECCs in Vision Transformers and a Zero-Cost Reliability Enhancement},
  author={Ahmadilivani, Mohammad Hasan and Roots, Marten and Restifo, Marco and Loorits, Sven-Markus and Di Mauro, Luca and Raik, Jaan},
  booktitle={2026 Design, Automation \& Test in Europe Conference (DATE)},
  pages={1--3},
  year={2026},
  organization={IEEE},
  link={https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=11539549}
}

Paper in IOLTS 2026

Introduced the CEP technique:

@article{ahmadilivani2026effective,
  title={Effective and Memory-Efficient Alternatives to ECC for Reliable Large-Scale DNNs},
  author={Ahmadilivani, Mohammad Hasan and Roots, Marten and Restifo, Marco and Loorits, Sven-Markus and Di Mauro, Luca and Raik, Jaan},
  booktitle={The 32nd IEEE International Symposium on On-Line Testing and Robust System Design (IOLTS)},
  year={2026},
  organization={IEEE},
  link={arXiv preprint arXiv:2605.07417}
}

License

UPL-1.0

Metadata

Release files for faultforge 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for faultforge 0.3.0
File Size Uploaded
faultforge-0.3.0.tar.gz 80.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for faultforge 0.3.0
File
faultforge-0.3.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
faultforge-0.3.0-cp314-cp314-manylinux_2_34_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ x86-64 Details
faultforge-0.3.0-cp314-cp314-manylinux_2_34_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ ARM64 Details
faultforge-0.3.0-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details

Total release size: 2.0 MB

Release files / faultforge-0.3.0.tar.gz

Download URL faultforge-0.3.0.tar.gz
Size 80.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2b2d957a87dd04c167cc7fb33a1629398cab388f48c0d66bf77b87f1254b447e
BLAKE2b-256 checksum
How to use checksums
71fe33d96e4af2a368cec4b59ab7a24e577486fc840930005f3d06c55e0ca075
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / faultforge-0.3.0-cp314-cp314-win_amd64.whl

Download URL faultforge-0.3.0-cp314-cp314-win_amd64.whl
Size 355.8 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
cda8dfacd96571af868014a438df402bd16cef55e810784cd22487a01e1da918
BLAKE2b-256 checksum
How to use checksums
ea4cec9a804695eb6935e8cf1366a7358354d2f5caffdf7d5dddaf03616223f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / faultforge-0.3.0-cp314-cp314-manylinux_2_34_x86_64.whl

Download URL faultforge-0.3.0-cp314-cp314-manylinux_2_34_x86_64.whl
Size 542.4 kB
Tags CPython 3.14 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
0ddad755814fbb0e66d19ed87ef45541fbee511f25a47d3ae898582869c61b01
BLAKE2b-256 checksum
How to use checksums
7be4676b731ceff4e63b12b782834a49cf391d13a840226bcfa581ac2b33eb55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / faultforge-0.3.0-cp314-cp314-manylinux_2_34_aarch64.whl

Download URL faultforge-0.3.0-cp314-cp314-manylinux_2_34_aarch64.whl
Size 541.8 kB
Tags CPython 3.14 Linux glibc 2.34+ ARM64
SHA-256 checksum
How to use checksums
c1211b500cb97747e3b7a4bb29e7eb44615db1035493666b18e22e9f9b13ccbb
BLAKE2b-256 checksum
How to use checksums
528944590ee5b6fbbc4a9e81ceb72baf89953a5c78e632ddee3cc3a14a756ca3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / faultforge-0.3.0-cp314-cp314-macosx_11_0_arm64.whl

Download URL faultforge-0.3.0-cp314-cp314-macosx_11_0_arm64.whl
Size 482.7 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2f52ee02664d67b622de45bafba8c958448aad1028c0ad2e6a4eca305503ac8b
BLAKE2b-256 checksum
How to use checksums
29704bf467fa2f66edb7a1befde2eaf3d3cfc11453ade3d8cbe678d68745fb8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

5 release files

0.2.1

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page