Skip to main content

FaultForge

CI License PyPI Python uv Built with Nix

A toolkit for reproducible hardware fault-injection experiments on PyTorch models.

Design principles

  • Standalone parts. Each component is useful by itself. Encode a tensor, inject faults into it, or summarize a list of scores without setting up anything else.
  • Built to fit together. The same parts combine into complete, resumable experiments with little glue code.
  • Use as much or as little as you need. Nothing forces you to adopt the rest of the toolkit to use one piece of it.
  • Extensible. The built-in models, encodings, metrics and experiments implement public base classes. Your own implementations plug in the same way.

Highlights

Building blocks:

  • Fault model - bit flips and stuck-at faults, a resumable repeat-free location sampler and batched injection.
  • Encodings - SECDED (Hamming codes), MSET and CEP, usable alone or chained together, and a wrapper that stores a model's parameters in encoded memory.
  • Metrics - a generic system for reliability metrics.
  • Model loading - models bundled with their evaluation datasets. Image classifiers on CIFAR-10/100 and ImageNet, and HuggingFace language models on WikiText, are built in.

Experiment harness:

  • Experiments - automatic run loops with clean Ctrl+C handling, and atomic, resumable, optionally zstd-compressed saving.
  • Estimators - mean, failure rate and non-finite rate, with 95% confidence intervals.
  • Stop conditions - run until an estimate is stable, for a fixed number of runs, or until interrupted.
  • Fingerprints - resuming a saved result with a changed configuration fails with a precise diff instead of silently mixing incompatible data.

Performance-critical paths are implemented in Rust.

docs/library.md walks through each part and ends with a complete example.

Installation

pip install faultforge
# or
uv add faultforge

See docs/installation.md for building from source and installing specific revisions.

Reference experiment

Encoded Memory injects faults into ECC-protected model parameters. It's a complete experiment built on FaultForge and the reference implementation to follow when writing your own. It also provides an encoded-memory CLI for recording results.

It lives in this repository and is released together with the library, but isn't published to PyPI. Its README covers installation.

Stability

FaultForge is experimental. Expect breaking changes in most releases, and check the changelog when upgrading. Versions follow semver: while the version is 0.x, minor releases can break and patch releases can't. A range like faultforge>=0.3.0,<0.4.0 picks up only compatible releases.

  • main is the development branch and can break at any point. The latest branch tracks the most recent release.
  • The Rust crates in this repository are internal and can change at any time. They aren't published, and their version only mirrors the library's.

Publications

FaultForge has been used to develop and evaluate the techniques in several papers. See docs/publications.md for links and citations.

License

FaultForge is licensed under the Universal Permissive License (UPL), Version 1.0. It's an OSI-approved permissive license that is about as short as MIT, but:

  • includes an explicit patent grant, like Apache-2.0.
  • is compatible with both GPLv2 and GPLv3. Apache-2.0 isn't compatible with GPLv2, which is why many projects dual-license under "MIT OR Apache-2.0".
  • extends the patent grant to larger works that include the software, not only the software itself.

The main condition is the same as MIT's: keep the copyright and license notice in copies of the software.

Metadata

Release files for faultforge 0.4.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.4.0
File Size Uploaded Provenance Actions
faultforge-0.4.0.tar.gz 111.2 kB With provenance Details for faultforge-0.4.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for faultforge 0.4.0
File Actions
faultforge-0.4.0-cp315-cp315t-macosx_11_0_arm64.whl CPython 3.15 CPython 3.15 free-threading macOS 11.0+ ARM64 Details for faultforge-0.4.0-cp315-cp315t-macosx_11_0_arm64.whl
faultforge-0.4.0-cp315-cp315-win_amd64.whl CPython 3.15 CPython 3.15 Windows x86-64 Details for faultforge-0.4.0-cp315-cp315-win_amd64.whl
faultforge-0.4.0-cp315-cp315-macosx_11_0_arm64.whl CPython 3.15 CPython 3.15 macOS 11.0+ ARM64 Details for faultforge-0.4.0-cp315-cp315-macosx_11_0_arm64.whl
faultforge-0.4.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for faultforge-0.4.0-cp314-cp314-win_amd64.whl
faultforge-0.4.0-cp314-cp314-manylinux_2_34_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ x86-64 Details for faultforge-0.4.0-cp314-cp314-manylinux_2_34_x86_64.whl
faultforge-0.4.0-cp314-cp314-manylinux_2_34_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ ARM64 Details for faultforge-0.4.0-cp314-cp314-manylinux_2_34_aarch64.whl
faultforge-0.4.0-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for faultforge-0.4.0-cp314-cp314-macosx_11_0_arm64.whl

Total release size: 3.2 MB

Release files / faultforge-0.4.0.tar.gz

Download URL faultforge-0.4.0.tar.gz
Size 111.2 kB
Tags Source
SHA-256 checksum
How to use checksums
fd87131929502cf028f3396c3aa06e11dab47130fe4feb27ab76f77a45b5ea34
BLAKE2b-256 checksum
How to use checksums
cdc8aaa8f62565cfaa90341efc9a1c879dde245b0483e854de1485e34b198f09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Release files / faultforge-0.4.0-cp315-cp315t-macosx_11_0_arm64.whl

Download URL faultforge-0.4.0-cp315-cp315t-macosx_11_0_arm64.whl
Size 463.3 kB
Tags CPython 3.15 CPython 3.15 free-threading macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
905edfaf7b884ef6a8e4b0e7bbde1dafdff884c747aafa275eacd7fa80ac164f
BLAKE2b-256 checksum
How to use checksums
16043a3bb088795cb3aefd301484cb429db3f51546d7addd7e87d2287b309d81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Release files / faultforge-0.4.0-cp315-cp315-win_amd64.whl

Download URL faultforge-0.4.0-cp315-cp315-win_amd64.whl
Size 342.7 kB
Tags CPython 3.15 Windows x86-64
SHA-256 checksum
How to use checksums
3f531917ca03c1bd823dceaab559995963e9850b37a847b02422863032d8b8a5
BLAKE2b-256 checksum
How to use checksums
60a9dcf6955880c4d97bede841824066db8783e3b1a4a2ef57135b91d4a6defa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Release files / faultforge-0.4.0-cp315-cp315-macosx_11_0_arm64.whl

Download URL faultforge-0.4.0-cp315-cp315-macosx_11_0_arm64.whl
Size 464.7 kB
Tags CPython 3.15 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6efd22a0655451428c805a972be9bb55df06432fb032fbb1de362ad9e86141c6
BLAKE2b-256 checksum
How to use checksums
aa23cd107f99849b63b4dec62ab901e886e0db61235a134c43d13bd64e61a15f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

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

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

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 Nov 19, 2026.

Transparency log

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

Download URL faultforge-0.4.0-cp314-cp314-manylinux_2_34_x86_64.whl
Size 518.9 kB
Tags CPython 3.14 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
b073181e0d24ae1298bec01b56ca4d2e25b6307cff7fef598c4ab12257acf584
BLAKE2b-256 checksum
How to use checksums
4b07356aa9d27e417e087a2017ff63f265d0e11d01110d081428fe11a3dcec9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

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

Download URL faultforge-0.4.0-cp314-cp314-manylinux_2_34_aarch64.whl
Size 512.4 kB
Tags CPython 3.14 Linux glibc 2.34+ ARM64
SHA-256 checksum
How to use checksums
d5f949a5ff3f5e99615d22c9112813cfe14a4336163391c1ec72a75efbff33ca
BLAKE2b-256 checksum
How to use checksums
1e79bc7c1415eba8c9630db6d798f58bbbc9e8b051ba78a461e2f88116d5ebc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

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

Download URL faultforge-0.4.0-cp314-cp314-macosx_11_0_arm64.whl
Size 465.0 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4a2b75046cdd5c6a942324804257338ddeb8a2c0b4863d116d47a3758f4d4bad
BLAKE2b-256 checksum
How to use checksums
7d398a9df744f406ddc4b033572f75fb6d0b5b18f4d1531f9ff246bb057c4080
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Security for faultforge 0.4.0

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.

Full provenance

All 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for faultforge-0.4.0.tar.gz

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 Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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