Skip to main content

auto-fio — Automated Flexible I/O tester

Profile your storage device and get the optimal I/O block size — automatically.

Python 3.9+ License: MIT


Why

Block-sequential data pipelines (like CFM64) need one hardware-dependent number: the smallest block size that saturates your device's sequential-read throughput. Picking it by hand means running an fio sweep and eyeballing the knee of the curve. auto-fio automates exactly that — sweep, measure, detect the knee, return the number.

Install

Prerequisite: install fio. auto-fio drives the fio benchmark for its gold-standard measurements (it uses --direct=1 to bypass the OS page cache). Install it first so it's on your PATH:

# macOS
brew install fio
# Debian/Ubuntu
sudo apt install fio
# Fedora/RHEL
sudo dnf install fio

Then install auto-fio:

pip install auto-fio

Without fio, auto-fio falls back to a portable, zero-dependency python backend so a result is always available — but its numbers can be optimistic where the OS caches the file. Install fio for publication-grade accuracy. See Backends.

If fio is missing, auto-fio tells you at runtime (on stderr) with the exact install command for your OS, then continues on the python backend — it never installs anything or touches your system for you. --json stdout stays clean. Silence the notice with --backend python.

Use it — command line

auto-fio /path/on/the/device
auto-fio · backend=fio · threshold=95%

    512 KiB    1180.4 MB/s
      1 MiB    1910.2 MB/s
      2 MiB    2740.9 MB/s
      4 MiB    3120.5 MB/s
      7 MiB    3305.1 MB/s  <-- optimal
     16 MiB    3319.8 MB/s
     32 MiB    3322.0 MB/s

Optimal block size: 7340032 bytes (7.0 MiB) — reaches 95% of the 3322 MB/s peak.

Machine-readable output for scripts/CI: auto-fio /data --json.

Use it — Python

import auto_fio

# Just the number (bytes):
block_size = auto_fio.optimal_block_size("/data")

# Full sweep + metadata:
result = auto_fio.profile("/data", threshold=0.95)
print(result.optimal_block_size, result.peak_throughput_mbps, result.backend)

Backends

Backend When Accuracy
fio fio is on PATH Gold standard — uses --direct=1 to bypass the OS page cache
python fio unavailable (default fallback) Portable, zero-dependency; cache eviction is best-effort (F_NOCACHE/posix_fadvise), so numbers can be optimistic where the OS caches the file

Force one with --backend fio / --backend python, or backend=... in Python. For publication-grade measurements, install fio and use the fio backend; the python backend exists so a result is always available and to cross-check fio.

How it decides — the "knee"

auto-fio measures throughput at each block size, finds the peak, and returns the smallest block size that reaches threshold (default 95%) of that peak. Smaller is better once saturated: it means fewer bytes buffered per read for the same bandwidth. This decision rule lives in a pure, unit-tested function (auto_fio.detect_knee) so it can be validated independently of any benchmark.

Companion to CFM64

import auto_fio
from cfm64 import CFM64Loader, TextBlockDataset

bs = auto_fio.optimal_block_size("/data/train")
dataset = TextBlockDataset("/data/train.csv", block_size_bytes=bs)
loader = CFM64Loader(dataset, batch_size=64, seed=42)

Run auto-fio once per machine, commit the number, and your pipeline is tuned to that hardware — no manual fio step.

License

MIT — see LICENSE.

Metadata

Release files for auto-fio 0.1.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 auto-fio 0.1.0
File Size Uploaded Provenance
auto_fio-0.1.0.tar.gz 13.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for auto-fio 0.1.0
File Interpreter ABI Platform
auto_fio-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.0 kB

Release files / auto_fio-0.1.0.tar.gz

Download URL auto_fio-0.1.0.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
dc7b67727b52b549134fc463b031e6cc8ab2f2e12e9bd8ffe9b83d3f90050f10
BLAKE2b-256 checksum
How to use checksums
c48a0fc64511d1b8064280130a33e66d52078db2b8964ae0398daf85172ab4dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 3, 2026.

Transparency log

Release files / auto_fio-0.1.0-py3-none-any.whl

Download URL auto_fio-0.1.0-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c01d3a3fc9dd04d0508294ec4a5c900d3f9b41618e0fcb3fe6e9afd2e22f2a17
BLAKE2b-256 checksum
How to use checksums
84dfae6efff2e76a1140cb14791c1ac9fd6cfbd88ed493c87431c0c503d864c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 3, 2026.

Transparency log

Security for auto-fio 0.1.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 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for auto_fio-0.1.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 Jul 3, 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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